Home > Enterprise >  Python code throws error while running in Visual Studio
Python code throws error while running in Visual Studio

Time:09-28

I am absolutely new to Python. I tried running this code

someone = 'Lovegood'
print (someone)

And I am getting this error

Traceback (most recent call last): File "", line 1, in NameError: name 'someone' is not defined**

Can someone please help me?

CodePudding user response:

Check whether you have selected a python interpreter in the visual studio or not. Also, make sure to save the file with a .py extension.

  • Related