8.your own while/else syntax problem


is there any syntax error?


Replace this line with your code.
if guess == random_number:
print "You win"


Please post all your code the error you're getting could be somewhere else.


from random import randint

random_number = randint(1, 10)

guesses_left = 3

while guesses_left>0:
guess = int(raw_input("Your guess:")
if guess == random_number:
print "You win!"
guesses_left -= 1
print "You lose."


and the structure is good i am sure


On this line you need an extra parentheses at the end. ) :slight_smile:

Should work after fixing that. :grin:


thank you very much :slight_smile:


You're welcome. :grin: If that was the answer you were looking for feel free to click the solution button. :grin: