All pastes #547372 Raw Edit

narthollis

public python v1 · immutable
·published 2007-06-07 11:12 UTC
rendered paste body
#!/usr/bin/pythonimport randomprint "Welcome to the randome number guesser app"mainloop = Truewhile (mainloop):        print "Please enter the minimum value"        min = int(raw_input())        print "Please enter the maximum value"        max = int(raw_input())        ran = random.randint(min, max)        guess = min - 1        i = 0        while ((i < 20) & (guess != ran)):                print "Enter your guess between %s and %s" % (min, max)                guess = int(raw_input())                i = i + 1        if guess == ran:                if (i < 3):                        print "Wow, you can read minds!"                else:                        print "Congratulations, thats it!"        else:                print "Better luck next time!"        print "Play again? (y/N)"        if (raw_input() != 'y'):                mainloop = False