def theloop(the_limit): """This function should loopback x amount of times.""" i = 0 numbers = [] while i < the_limit: print "At the top i is %d" % i numbers.append(i) i += 1 print "Numbers now: ", numbers print "At the bottom i is %d" % i print "The numbers: " for num in numbers: print num print "How many time would you like this loop to run?" set_limit = int(input("Enter Number: ")) theloop(set_limit)