#1

Oops, try again. Did you allow the user 3 guesses, or did you incorrectly detect a correct guess?

To allow three guesses and if three wrong then "You Lose"

``````from random import randint

# Generates a number from 1 through 10 inclusive
random_number = randint(1, 10)

guesses_left = 3
while guesses_left > 0:

if guess == random_number:
print "You win!"
break
elif guess != random_number:
guesses_left -= 1
break;
else:
print "You lose."

#2

``````# Generates a number from 1 through 10 inclusive
random_number = randint(1, 10)
print "All right, you wanna play Guess the Number?"
wanna_play = (raw_input("Wanna play? "))
print "I didn't really hear you, but I don't care."
print "I'm gonna choose one number between 1 and 10. You HAVE to guess."
guesses_left = 3
while guesses_left >= 1:
if guess == random_number:
print "You guessed right. You win, I guess."
break
else:
print "Wrong."
guesses_left -= 1
else:
print "Game over. You lose. Ha!"``````

This thingy worked for me.

#3

The error lies in your elif statement. We put a break after if because we want to break the loop (the user guessed correctly). However, if we put a break after the elif statement, it disallows the loop to continue. Basically, delete the break from the elif statement and the loop will continue until the guesses_left variable does in fact=0.