-
-
Save codecademydev/0ac7a6f4fd4b5d08fc476462fda6e625 to your computer and use it in GitHub Desktop.
Codecademy export
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
from random import randint | |
# Generates a number from 1 through 10 inclusive | |
random_number = randint(1, 10) | |
guesses_left = 3 | |
# Start your game! | |
while guesses_left > 0: | |
guess = int(raw_input("Your guess: ")) | |
if guess == random_number: | |
print "You win!" | |
break | |
guesses_left -= 1 | |
else: | |
print "You lose." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment