The TypeError: 'str' object is not callable (Python) What needs to be done?

719    Asked by ItoYamaguchi in Python , Asked on Mar 2, 2021
Answered by Ito Yamaguchi

The error you are getting because of the following reason:-

global str

str = str(mar)

You are redefining what str() means. str is the built-in Python name of the string type, and you don't want to change it.

Use a different name for the local variable, and remove the global statement.


Your Answer

Interviews

Parent Categories