Python Python Basics Meet Python Syntax and Errors

Dejan Delev
Dejan Delev
461 Points

different error message

in the video it shows NameError, however what I get is

File "<stdin>", line 1
python hello.py
^
SyntaxError: invalid syntax

Am I doing something wrong or is it normal?

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 42,593 Points

if you type just hello.py into the first one you should see a name error. If you type python hello.py into the second one you'll run the script

>>> hello.py                                                                             
Traceback (most recent call last):                                                       
  File "<stdin>", line 1, in <module>                                                    
NameError: name 'hello' is not defined                                                   
>>>                                                                                      
treehouse:~/workspace$ python hello.py                                                   
Hello, World             
KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 42,593 Points

Are you entering the command in the python interpreter? Do you see this:

>>>                                                                                      

or this:

treehouse:~/workspace$

?