According to the program, I solved this exercise, but the perfectionist in me doesn’t accept that.
When I guess correctly, it still tells me I’ve guessed incorrectly.
My code (including a
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 = raw_input("Pick a number: ") if guess == random_number: print "You win!" break guesses_left -= 1 else: print "You lose."
And after I changed it to let me have ten guesses:
I think this game is rigged.