What is the syntax error?


#1

I know that some of the code following the while statement is incorrect, but I am unable to debug it, since I get syntax error from line 9 (my while loop):

from random import randint

Generates a number from 1 through 10 inclusive

random_number = randint(1, 10)

guesses_left = 3
guess = int(raw_input("Your guess: ")

while guesses_left > 0:
if guess == random_number:
print "You win!"
break
guesses_left -= 1
else:
print "You lose"

What is the syntax error?


#2

You need an extra parenthesis at the end of the line "guess = int(raw_input("Your guess: ")"
Should look like this:
guess = int(raw_input("Your guess: "))

The interpreter is confused and will say its on the next line.