I am learning Python now.
At my very first program I am getting following error.
>>> python first_tutorial.py
File "<stdin>", line 1
python first_tutorial.py
^
SyntaxError: invalid syntax
>>>
Below is my code in that file -
name = "John"
age = 19
print name
print age
I am using following Python 3.5.1 version on Windows 10
I can print simple text from cmd line but no able to run script from file.
Update
I am running it from command line itself.. first I make a folder on my docs then run cmd line and type python after that when I just type print "Hello" it works fine but when I run python file like python first_tutorial.py it shows error
Any guidance please.
Thanks
first_tutorial.pyandfirsttutorial.pyseems to be a little different. Anyway, more seriously, have you set the path of the Python interpreter?>>>arrows show you are trying to run python from python, not the command pythonprint namerather thanpython first_tutorial.py. That means that your current problem is solved. Theprint nameis a separate problem. To fix that, useprint(name). Likewise,print(age).