import random num = random.randint(1,10) print "I'm thinking of a number between 1 and 10." guesses = int( raw_input("How many guesses? ") ) # give them their guesses for attempt in range(guesses): guess = int( raw_input("Guess number " + str(attempt+1) + ": ") ) if guessnum: print "That was too big." else: print "Yup, that's it." break # don't keep guessing after they get it. print "Thanks for playing the game!"