import random number = random.randint(1, 100) print("I am thinking of a number between 1 and 100") while True: answer = int(input("What is it?: ")) if answer > number: print("Too high, try again.") elif answer < number: print("Too low, try again.") else: print("You got it!") break