/ Published in: Python
Expand |
Embed | Plain Text
import sys import random salir = "" numero = random.randrange(1,10,1) print "Guess the number I'm thinking of 1 to 10" while salir != "q": respuesta = input("Enter the number you think I'm thinking between 1 and 10\n") if respuesta == numero: print "That's it" raw_input() sys.exit() elif respuesta < numero: print "The number is greater than this try again" elif respuesta > numero: print "The number is small than this try again" else: print "You have not written anything." salir = raw_input("Press q to exit and enter to try again")
You need to login to post a comment.
