import random randomnumber = random.randint(1,101) print("I'm thinking of a number...") while True: number = int(input("Pick a number: ")) if number > randomnumber: print("Lower!") if number < randomnumber: print("Higher!") if number == randomnumber: print("You got it!") if number == randomnumber: break