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.

  1. We’ll want to put it under the else that accounts for misses
  2. We’ll want to print the message no matter what the cause of the miss
  3. Since our turn variable starts at 0 and goes to 3, we will want to end the game when turn equals 3.



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

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?