+ 1
I can't understand syntax error in this code. Please help me understand what went wrong in the line 5 of this code.
TargetGuess = 25 i = 4 while i>0 or i == 0: guess = int(input('Please enter your guess.you have 5 guesses left: ') i=i-1 if guess == TargetGuess: print('You Won!......you have guessed it rightly.Congratulations!') elif guess < TargetGuess: print('oops.your guess is lower than the actual number. Guess again: ') elif guess > TargetGuess: print('oops.your guess is greater than the actual number. Guess again: ') print('You have ',i+1,'guesses left')
3 Respostas
+ 5
You didn't close the bracket adequately on line 4. There are two opening brackets there but only single closing one.
+ 2
Robin Sain
You close the input's brackets but forgot to close int's brackets... :)
0
Thank you so much for replying so fast.