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
Sherlock Jiang
5,446 PointsI am using the workspace for testing but can't call python script
I entered "python test.py" in the console, but got SyntaxError all the time. I saved the file already.
4 Answers
Keerthi Suria Kumar Arumugam
4,585 PointsCan you share your code? There might be a mistake in your code
Richard Boag
5,547 PointsI get syntax errors constantly too, and I recreated the commands verbatim from the tutorial. Please check my code, thanks!
name = input("What's your name? ")
if name == "Rich": print(name + " is a lumberjack and he's OK!") else: print(name + " sleeps all night and " + name + " works all day!")
Keerthi Suria Kumar Arumugam
4,585 PointsI just checked and it runs fine for me. Remember though that your indentations are important in Python. Refer the code below. I would advise you to check your indents
name = input("What's your name? ")
if name == "Rich":
print(name + " is a lumberjack and he's OK!")
else:
print(name + " sleeps all night and " + name + " works all day!")
Richard Boag
5,547 PointsFigured it out, I had to quit() to run the program, thanks!