Created
December 30, 2015 05:52
-
-
Save libert-xyz/0ceab7fb19ccb053ee5b to your computer and use it in GitHub Desktop.
A simple Guest the Number Game
This file contains 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
#!/usr/bin/env python | |
from random import randint | |
opt = 3 | |
rn = (randint(100,199)) | |
while opt >= 0: | |
if opt == 0: | |
print "You Lost, the number was: ", rn | |
break | |
else: | |
num = int(raw_input("Guess a Number Between 100 and 199: ")) | |
if num == rn: | |
print "YES! you won 1,000,000 $" | |
opt = -1 | |
else: | |
if num > rn: | |
print "Less, Keep Trying, ","Opportunities: " , opt-1 | |
opt = opt - 1 | |
else: | |
print "Greater, Keep Trying, " , "Opportunities: ", opt -1 | |
opt = opt -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment