Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Meet Python Variables

Getting syntax error when trying to run hello.py

when i do the same as the video and try to run, i'm given a syntax error. when hit tab after typing python, a space is all that appears. what haver i forgotten?

Ricky White
Ricky White
8,799 Points

Are you able to share your code / screen so we can see what the problem is?

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hey joseph, are you typing python hello.py ?

2 Answers

I was stuck with this too, remember to save if there's a red dot next to the script name. Either through the menu or by ctrl + s. Then run after that, it should work :)

This is the code from the end of the video

first_name = 11

print("Hello, Craig")
print("Hello,", first_name)

print("Craig is learning Python")
print(first_name, "is learning Python")

outputs

Hello, Craig Hello, 11 Craig is learning Python 11 is learning Python