import random targetnumber= random.randint(1, 100) print("Im thinking of a number... ") guess= int(input("Guess the number: ")) while True: if guess == targetnumber: print("You got it!") elif guess < targetnumber: print("Higher!") else: print("Lower!") break while guess != targetnumber: guess= int(input("Guess the number: "))