I am new to Python programming language reading books and attending some online courses.
I am currently using the Visual Studio Code software.
During working on the “input” function, I typed “>>> name = input(‘ […]” (I ommitted the details) and I received the following message from the aforementioned software:
Traceback (most recent call last):
File “”, line 1, in
TypeError: ‘str’ object is not callable
However, I typed the same command using the simple code editor that accompanies the python software, and I did not receive any mistake-related message.
You are getting an error because you have a string and tried to call it like a function.
That’s all there is to say, given you decided to share virtually no code.
Then go through the code and look for the word “input”?
There propably is a line like input = "some text" → Python will then just override the keyword with the string. That’s what Jeremy meant with “shadowed”, somewhere in the code, this is happening.
As I am not super educated on the Python interpreter, I cannot say if the shadowing has to happen in a prior line or could be anywhere in the file or even imported modules…