Last active
November 7, 2015 20:19
-
-
Save foresmac/4c46db080073b33fac96 to your computer and use it in GitHub Desktop.
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
import random | |
number_list = [i + 1 for i in range(100)] | |
pick = random.choice(number_list) | |
print 'I am thinking of a number from 1 to 100' | |
turn = 1 | |
while turn < 6: | |
guess = raw_input('Type your guess: ') | |
guess = int(guess) | |
if guess == pick: | |
print 'You win! Great job!' | |
elif turn < 5: | |
if guess > pick: | |
print 'Too high!' | |
if guess < pick: | |
print 'Too low!' | |
print 'Try Again...' | |
else: | |
print 'Sorry, the number was {0}.'.format(pick) | |
turn = turn + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment