Oct-17-2021, 06:43 PM
I keep getting this name error message when I just want to print the value of x.
The picture clearly shows that I am defining x [x = 5].
I have uninstalled and reinstalled both Python 3.10 and Visual Studio Code several times
but the error persists.
Even VS Code says it sees no problems in the workspace after typing in this simple program.
What should I do?
The picture clearly shows that I am defining x [x = 5].
I have uninstalled and reinstalled both Python 3.10 and Visual Studio Code several times
but the error persists.
Even VS Code says it sees no problems in the workspace after typing in this simple program.
What should I do?
x = 5 print(x)
Error:>>> print(x)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined