Guess program in python

 g = 5

while(g<6):
print("Enter an Number to guess")
num=int(input())

g=g-1
if num>18:
print("Please try smaller value")

elif num<18:
print("Please try larger value")

elif num==18:
print("Yes!! Right Guess")
break

print("You have ",g,"guesses left")

if g==0:
print("Game Over!!")
break


Comments

Popular posts from this blog

Create A dictionary . Take input from the user and display its meaning.

How to add elements to the list