Python Python Basics Types and Branching If, Else and Elif

I can not figure out why I am getting this Syntax error. Please help.

treehouse:~/workspace$ python
Python 3.6.4 (default, Apr 11 2019, 19:31:33)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

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

This is my code up top:

first_name = input("What is your first name? ")
print("Hello,", first_name) if first_name == "Angie" : print (first_name, "is learning Python") print ("Have a great day {}!).format(first_name))

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 47,300 Points

At the workspace prompt you can type python hello.py to run your program:

treehouse:~/workspace$ python hello.py 

At the python prompt type import hello for the same results

>>> import hello

You also need to fix your code. There should be a quotation mark after ! instead of a parenthesis

print ("Have a great day {}!".format(first_name))

Thanks for the help! I appreciate it. :)