Advertisement
Guest User

EightBall

a guest
Nov 24th, 2014
1,141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. import random
  2.  
  3. def main ():
  4.     input("Enter your question!:     ")
  5.     EightBall = ["Yes", "No", "Try Again", "I'm not sure at this time", "Patience will server you well", "42"]
  6.     i = random.randrange(0, 6)
  7.     print(EightBall[i])
  8.     restart()
  9. def restart():
  10.     yn = input("Try again? Yes/No:     ")
  11.     ynLower = yn.lower()
  12.     if ynLower == "y" or ynLower == "yes":
  13.         main()
  14.     elif ynLower == "n" or ynLower == "no" :
  15.         print("Good bye!")
  16.         quit()
  17.     else:
  18.         print("Invalid entry, try again.")
  19.         restart()
  20.    
  21. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement