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 trialNicolas Bassano
2,125 PointsI found this fixing my crappy code
I found this fixing my code wich was full of bugs
It happens on Kenneth's code too. The code line below ............I mean it shows but really fast and goes straight to "Press enter/return to start or Q to quit "
print('Welcome to Letter Guess!')
Here is the full function
def welcome():
start = input("Press enter/return to start or Q to quit ").lower()
if start == 'q':
print("Bye!")
sys.exit()
else:
return True
print('Welcome to Letter Guess!')
Putting it this way (see below) It works as it should be (at least thats what I think.....) Is this the right place for it???
def welcome():
print('Welcome to Letter Guess!')
start = input("Press enter/return to start or Q to quit ").lower()
if start == 'q':
print("Bye!")
sys.exit()
else:
return True
2 Answers
Steven Parker
231,269 PointsI think the original intention was to show that message only once.
But as you noticed, the clear screen keeps it from being visible long enough to see. Your solution shows it each time the game restarts, but that seems consistent with the nature of the message. Good job!
We should probably tag Kenneth Love to call this to his attention.
Kenneth Love
Treehouse Guest TeacherYeah, it was meant to only show the first time you play the game. After that, you know what game you're playing!
But, still, good idea to change it and that's a solid fix. Great work!
Nicolas Bassano
2,125 PointsNicolas Bassano
2,125 Pointsaha, like you say, it should show at least the first time. Maybe trivial if we continue playing the game.
But I have no idea how to do that.