My error message: Oops, try again. Did you include an else for the while loop?
Who knows what is the mistake?
from random import randint random_number = randint(1, 10) guesses_left = 3 while guesses_left > 0: guess = int(raw_input('Your guess: ')) if guess == random_number: print 'You win!' break else: print 'You lose.' guesses_left -= 1