Skip to content Skip to sidebar Skip to footer

Python Str Object Is Not Callable In Spyder

I have been trying to use str() function to convert the integer to string in Spyder (python 2.7). Every time I got TypeError: 'str' object is not callable For example, I wrote this

Solution 1:

You have overwritten the built-in str somewhere in your code.

>>> str = 'foo'   # overwriting the builtin `str`
>>> x = 5
>>> print str(x)  # equivalent to 'foo'(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable

Post a Comment for "Python Str Object Is Not Callable In Spyder"