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 trialJuliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Pointspython lumberjack.py syntax error
name = input("What's your name? ")
if name == "Juliette":
print(name + " is a lumberjack and she's OK!")
else:
print(name + " sleeps all night and " + name + " works all day!")
I am getting an invalid syntax error when attempting to run python lumberjack.py in the Workspaces console.
What could be wrong?
Thanks!
2 Answers
Chris Freeman
Treehouse Moderator 68,441 PointsThe syntax of the code is correct. Can you post the syntax error message?
qlpxjevhuv
10,503 PointsYou have to run the exit() command and clear command before executing the lumberjack.py project.
exit()
clear()
python lumberjack.py
Wan Di
5,785 PointsHi Tomasz, I followed this and I got this error:
python lumberjack.py
bash: syntax error near unexpected token `python'
Any help? I am still stuck...
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 PointsJuliette Tworsey
Front End Web Development Techdegree Graduate 32,425 PointsHmmm...I re-loaded the Workspace and now it's working....:-)
Thanks Chris-