from random import randint answer = randint(0,100) correct = False while not(correct): guess = int(input("Guess a number: ")) if guess < answer: print("Too low") elif guess > answer: print("Too high") else: print("Correct!") correct = True