How can I fix this error?
I’m facing this error on every example I’m trying to run. I’m new to Python and trying to add spaces in my code.
This is my code
spaces = '' * 12 print('add some spaces in this text' % spaces)
And I’m getting this error
TypeError: 'str' object is not callable
Advertisement
Answer
fix
spaces= ' ' * 12 print('add some spaces in this text'.replace(' ', spaces))
output
add some spaces in this text