I have created this code but when ever it is run it just returns "Too high". No matter what is there an obvious error. import random print "Welcome to this random number guessing game" x = random.randint(1, 30) print "A number between 1 and 30 has been calculated you must guess it" guess = 5 while guess != 0: gues = raw_input("Guess: ") if gues < x: print "Too low" guess = guess - 1 if gues > x: print "Too high" guess = guess - 1 if gues == x: print "You got it! Good for you" raw_input() quit()
Aucun commentaire:
Enregistrer un commentaire