8.your own while/else syntax problem


#1



is there any syntax error?


`python

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


#2

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


#3

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
else:
print "You lose."


#4

and the structure is good i am sure


#5

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

Should work after fixing that. :grin:


#6

thank you very much :slight_smile:


#7

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