8. Your own while / else syntax error


#1

Can anyone tell me what's wrong with the following code? When I run it I get a syntax error identifying the colon at the end of the line " if guess == random_number:", but I don't understand why it's wrong.

Thanks!

"""
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: ")
    if guess == random_number:
        print "You win"
        break
    guesses_left -= 1
else:
    print "You lose"
"""

#2

You forgot a ) the line above it.


#3

Thanks!