For some reason, my code gives a syntax error on line 10. I have no idea how, it changes color (shows in bold here), has a variable and a condition, and an indent for the rest of the code. What am I missing?
I'm trying to get the loop to work, and I've even copy-pasted other functioning scrips in my own (of course after verifying that I've done it correctly), but it still says I'm doing something wrong.
from random import randint # Generates a number from 1 through 10 inclusive random_number = randint(1, 10) guesses_left = 3 while guesses_left > 0: guess = int(raw_input("Guess my number... ") if guess == random_number: print "You win!" break guesses_left -= 1 else: print "You lose."