import random
import sys

ans ="wrong"

print ("Please try to guess the number between 1 and 100\n")

target = random.randrange(1,100)

while (ans == "wrong"):
    print("enter your guess ( betwee 1 and 100) : ", end="")

    num_in_str = sys.stdin.readline()  #brings a string with a "\n" on the end

    num_in_str.strip()  #this removes the "\n"
    guess_num = int(num_in_str) #this converts the string to an integer

    if (guess_num == target):
        print ("\nYAE!  That's it!")
        ans = "right"
    else:
        print("\nWrong! ")
        if (guess_num > target):
            print("too high")
        else:
            print("too low")
            
        



    

    
