Learn
If someone runs out of guesses without winning right now, the game just exits. It would be nice to let them know why.
Since we only want this message to display if the user guesses wrong on their last turn, we need to think carefully about where to put it.
- We’ll want to put it under the
else
that accounts for misses - We’ll want to print the message no matter what the cause of the miss
- Since our
turn
variable starts at 0 and goes to 3, we will want to end the game whenturn
equals3
.
Instructions
1.
Add an if
statement that checks to see if the user is out of guesses.
- Put it under the
else
that accounts for misses. - Put it after the
if/elif/else
statements that check for the reason the player missed. We want"Game Over"
to print regardless of the reason.
If turn
equals 3
, print "Game Over"
.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.