PATX commented on a Page, Python 8ball script  -  Oct 30, 2009
#!/usr/bin/env python

import random

x = raw_input("Please ask a question: ")
n = random.randint(1, 7) 
if n == (1):
   print("The answer lies in your heart")
elif n == (2):
     print("I do not know")
elif n == (3):
     print("Almost certainly")
elif n == (4):
     print("No")
elif n == (5):
     print ("Why do you need to ask?")
elif n == (6):
     print("Go away. I do not wish to answer at this time.")
elif n == (7):
     print("Time will only tell")

^ cleaner simpler and more standard way of doing it.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.