from random import randint # Generates a number from 1 through 10 inclusive random_number = randint(1, 10) guesses_left = 3 # Start your game! while guesses_left>0: g=int(raw_input("Your guess: ")) if g==random_number: print "You Win!" break else: print "You Lose" guesses_left-=1
What have I done wrong here? Tried multiple times where win and loss both have been executed outcomes! Still can't make the move and showing "Oops, try again.
Did you include an else for the while loop?"
I have included the while loop. What should be done next? Any help will be highly appreciated