The code that I have created doesn't really work but Codecademy says it works. It won't let you win at all. Please let me know about the problem in my code and how I should fix it.
from random import randint random_number = randint(1, 10) print random_number guesses_left = 3 while guesses_left > 0: guess = raw_input('Guess') if guess == random_number: print 'You have won.' break else: print 'Wrong' guesses_left -= 1 else: print 'You lose.'