import random def main(max): print "\tWelcome to 'Guess my number'!" print "\nI'm thinking of a number between 1 and 100." bestoutof = raw_input("Best out of : ") num = random.randrange(101) tries = bestoutof guess = "" while guess != num: guess = int(raw_input("Take a guess: ")) if guess > num: print "Too high." elif guess < num: print "Too low." if tries >= bestoutof: print "Sorry, you took too many guesses. Game Over" exit() print "Congratulations!" again = raw_input("To play again press Enter. Type anything else to quit.") if again == "": main() else: exit main(3)
i need it to have a best of ? loop it be in this program but i just cant seem to get it right
Any suggestion ?????