When ever I type in the number correctly incorrectly, it says that, "Did you include an else for the while loop?"
But, as you can see, I have an else under the if in my while loop, can someone help me?
from random import randint # Generates a number from 1 through 10 inclusive random_number = randint(1, 10) print random_number guesses_left = 3 # Start your game! while guesses_left > 0: guess = int(raw_input("Your guess: \n")) guesses_left -=1 if guess == random_number: print 'You win!' guesses_left = 0 break else: print 'You lose' break