import random num = random.randint(1,10) print "I'm thinking of a number between 1 and 10." guess = int(raw_input("Take a guess: ")) # keep trying until they get it while guess!=num: if guess