Continuing the discussion from Loops 8/19; You Own While/Else:
from random import randint # Generates a number from 1 through 10 inclusive random_number = randint(1, 10) print random_number guesses_left=3 while guesses_left> 0: guess= int(raw_input("Your guess")) if guess==random_number: print 'You Win!' break else: guesses_left -=1 if guesses_left<0: print 'You Lose!'
can u please help with mistake I am doing
I do not get out of loop even after 3 guesses