|'str' object is not callable - python error
What is ‘str’?
The str() function converts values into a string.
If your program returns 'str' object is not callable error, there are two main reasons for that.
- Using ‘str’ as a variable:
- Calling a string as a function
Since ‘str’ is a pre-defined function in python, you cannot use it as a variable
to fix it just use a different name for defining the variable.
this returns an error because I used the variable text as an function →
to fix it →
- Source: freecodecamp
- Wrote: December 28, 2022 | Dey 7, 1401
- Updated:
- Posted: December 28, 2022 | Dey 7, 1401