Created
August 30, 2014 19:01
-
-
Save prakhar1989/03cb8846201f86128e64 to your computer and use it in GitHub Desktop.
Game
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
import random | |
if __name__ == "__main__": | |
# this decides whether the user wants to continue | |
choice = True | |
# the main game loop | |
while choice: | |
print "Random number: " + str(random.random() * 100) | |
print "Do you want to continue? Y/N?: ", | |
user_choice = raw_input() | |
if user_choice == 'n' or user_choice == "N": | |
print "Thanks for playing!!!" | |
choice = False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the user guesses
N