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