theholder commented on a Page, Python 8ball script  -  Apr 27, 2011

IMPORTS

import sys,re,random

END

THIS WILL WORK WITH PYTHON3.2

while True:
x = input("Please ask a question: ")
n = random.randint(1, 7)
if re.match("^exit$|^close$", x):
print("GoodBye!")
sys.exit()
elif 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")

 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.