i’m trying to convert string to float, but appears this type error:
TypeError Traceback (most recent call last)
in <cell line: 1>()
—-> 1 year=int(input(“tell me your birth date: “))
TypeError: ‘str’ object is not callable
this is the code that i’m trying:
year=int(input(“tell me your birth date: “))
—
thanks 🙂
Gemni brought this response, but i check the code and don’t make sense:
It seems like you might have accidentally overwritten the built-in input() function with a string variable named ‘input’ somewhere in your code. This is causing the TypeError: ‘str’ object is not callable because you’re trying to call a string as if it were a function. The global variables show that you have a variable ano_usuario which contains a string. It’s possible that you previously assigned a string to a variable named input.
i try this, suggested by Gemni, but didn’t work:
Clear the ‘input’ variable if it exists
if ‘input’ in globals():
del input
Gabriela Lira Bertolo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.