n = random.randint(1, 10)
g = int(input('Enter a whole number between 1 and 10: '))
while g != n:
    if g > n:
        g = int(input('Your number was too high, pick a lower one: '))
Hotter/Colder Number Game in Python