How do you rest your variable everytime your execute the program.
for x in range(1,100): running = True while running: guess = int(raw_input("Enter an integer:")) if guess == x: print "Nice" running = False if guess < x: print "Higher" running = True if guess > x: print "Lower" running = True raw_input("Press enter to continue....")
Everytime I execute it the answer is 99, how do I reset the variable everytime I execute the program. Also do I need that while loop even though I have the for loop? I just used for loop because I don't know how to store a random integer. Thanks for the help.