#8 while/else


Please help me fix my error

The console runs the way I expected, but i get the error
Oops, try again. Did you include an else for the while loop?

# Generates a number from 1 through 10 inclusive
random_number = randint(1, 10)

guesses_left = 3
# Start your game!
print "guess my number 1- 10"
while guesses_left > 0:
    print "Guesses remaining", guesses_left
    guess = int(raw_input("Your guess:  "))
    if guess == random_number:
        print "You Win"
        print " sorry"
        guesses_left  -= 1
    if guesses_left == 0:
        print "game over"


The error message would indicate the lesson checker is looking for,

while ____:


    print "You lose."


Thank you for your help:smiley_cat:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.