4/18 How is this a bad syntax?


'''from random import randint
random_number = randint(1, 10)

guesses_left = 3

while guessesleft > 0:
guess = int(rawinput("Your guess: "))
if guess == randomnumber:
print "You Win!"
guessesleft -= 1
print "You lose'''

The error message is: File "python", line 12
SyntaxError: invalid syntax


After if you have break which would ignore any if's and else's after it (If it reached that point) so when it reaches break it leaves the if operation then you add an else out of nowhere. Remove the break or change the else to if. Also that guessesleft -= 1 will never be reached.