Created
November 22, 2013 18:20
-
-
Save bitoffdev/7604501 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
max = randint(1, 1000) | |
number = randint(0, max) | |
guess = -1 | |
print "I'm thinking of a number between 0 and %d!" %max | |
while True: | |
try: | |
guess = int(raw_input("Guess a Number: ")) | |
if guess==number: | |
print "Correct!" | |
break | |
elif guess>number: | |
print "Too High!" | |
else: | |
print "Too Low!" | |
except ValueError: | |
print "That's not a number!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment