edumeister_logo

import randomprint("Enter a guess between (1-20)")showing page 1 out of 1

import random
print("Enter a guess between (1-20)")
number=random.randint(1,20)
i=0
while i<4:
guess = input("what is the number?")
guess=int(guess)
#print("the correct number is ",number)
if guess > number:
print("it is too high")
i=i+1
elif guess < number:
print("it is too low")
i=i+1
elif guess > 20:
print("this is not between 1 and 20")
i=i+1
elif guess == number:
print("you have entered the correct number.")
break
if i==4:
print("game over. you are running out of guess. The correct answer is" + str(number))