I need a string consisting of a repetition of a particular character. At the Python console, if I type:
n = '0'*8
then n
gets assigned a string consisting of 8 zeroes, which is what I expect.
But, if I have the same in a Python program (.py
file), then the program aborts with an error sayingcan't multiply sequence by non-int of type 'str'
Any way to fix this?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With