import random # set the initial values from 1 to 5the_number = random.randrange(5) + 1guess = int(raw_input("Take a guess: "))tries = 1# guessing loopwhile (guess != the_number): if (guess > the_number): print "Lower..." else: print "Higher..." guess = int(raw_input("Take a guess: ")) tries += 1print "You guessed it! The number was", the_numberprint "And it only took you", tries, "tries!n"
Name (required)
email (will not be published) (required)
Website