Guess the number game using python

 Guess the number game using python


the correct answer is 8 , if the user inputs 8 within 5 guesses he wins but if he cannot guess he loses


num=8
gus=5
while(gus>0):
print("number of guesses left >>",gus)
print("input your guessed number :")
inp=int(input())
gus=gus-1
if inp> num:
print("enter lesser")
continue
elif inp< num:
print("enter greater")
continue
elif inp==num:
print("congrats you enter number correct")
break
if gus==0:
print("you are out of guesses GAME OVER")

Comments