Advertisement
Guest User

8 Ball Practice

a guest
Jul 11th, 2014
9,986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. import random
  2. import time
  3. import sys
  4.  
  5. list = ["Yes, most definitely!", "The chances are high!", "Not likely!", "May the odds be ever in your favor.",
  6.             "You got no shot, kid.", "Try it out and see!", "23% of working", "99.9% success rate",
  7.             "Congratulations, yes!", "Ask a probably question," "Ask again later", "Better not tell you now",
  8.            "Cannot predict now", "Concentrate and ask again", "Don't count on it"
  9.     ]
  10. def userinput():
  11.     question = 'Enter your question:'
  12.     print(question)
  13.     stuff = input("> ")
  14.  
  15.     print("\nThinking..\n")
  16.     time.sleep(3)
  17.     print(random.choice(list))
  18.    
  19.     final()
  20.    
  21. def final():
  22.     print("Would you like to ask another question?")
  23.     user_reply = input('> ')
  24.     while(input):
  25.         if user_reply == "yes":
  26.             userinput()
  27.         else:
  28.             print("Thanks for playing!")
  29.             sys.exit(0)
  30. print("Welcome to the Magic 8 Ball!")
  31. userinput()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement