n =18
attempt = 0
print("You have only 9 attempt remain")
while(1):
if(attempt < 9):
print("Please Enter the number")
user_input = int(input())
if(user_input > n):
print("Number is greater")
attempt = attempt + 1
print("Number of attempt is " + str(attempt))
continue
elif(user_input < n):
print("Number is lesser")
attempt = attempt +1
print("Number of attempt is " + str(attempt))
continue
elif(user_input == n):
print("You Guess Right Number")
attempt = attempt +1
print("Attempt number when he guess12 " + str(attempt))
break
else:
print("Game Is over ... beacuse you use the 9 attempt")
break
Thanks you for commenting your questions. I will see question and respond you.