perfect code for guess the number
# guess wala game
print("You have only 9 attempt to guess the nunber")
hima=1
while(hima<=9):
qwer=int(input("Enter your number:" ))
if qwer>=20:
print("you have to choose number less than you enter")
elif 18<qwer<20:
print("you have to choose a number very less lesser than you enter")
elif qwer<=15:
print("you have to choose number greater than you enter:")
elif 15<qwer<18:
print("you have to choose a number very less greater than you enter")
elif qwer==17:
print("You are very close to your desire number")
elif qwer==19:
print("You are very close to your desire number")
qwer=qwer+1
continue
elif qwer==18:
print("YOU WIN!! You guess the correct number")
break
print (9-hima,":number of guess left")
hima = hima +1
if hima >9:
print("Sorry but, YOU LOOSES THE GAME")
Comments
Post a Comment