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 trialChristopher Lobato
1,625 PointsI have no idea what could possibly be wrong, but I'm getting a syntax error on a colon when I tried this script...
def welcome(): start = input("Press enter/return to start or Q to quit. ".lower()
if start == 'q': <------------------------------ What could possibly be wrong here???
print ("Bye!")
sys.exit()
else:
return True
print ("Welcome to Leter Guess!")
done = False
while True: clear() welcome() play(done)
2 Answers
John Simmons
1,247 PointsAre you mixing tabs/spaces? Have you imported sys?
Christopher Lobato
1,625 PointsThis is the exact code he used in the video. I've redone the indentation a million times, sys has been imported. It just keeps popping up with a syntax error only on that colon.
Nikolai Montesclaros
11,928 PointsNot sure about the context of the question but syntactically I can see that you have a space on your print statement.
print("Bye")
Christopher Lobato
1,625 PointsHere we go.
def welcome():
start = input("Press enter/return to start or Q to quit. ".lower()
if start == 'q':
print ("Bye!")
sys.exit()
else:
return True
john larson
16,594 Pointsjohn larson
16,594 PointsHey Chris, did this ever get resolved?