-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmagic-8.py
45 lines (39 loc) · 1.14 KB
/
magic-8.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import random
import time, sys
play_again = 'yes'
while play_again == 'yes':
str(input("Welcome to your shady Magic 8-Ball. Enter your question: ")).lower()
# Delay output for 1 second each
print("Wait there while I get my tea...")
time.sleep(1)
print("3...")
time.sleep(1)
print("2...")
time.sleep(1)
print("1...")
time.sleep(1)
print()
# Generate a random integer/response
response = random.randint(0, 8)
if response == 1:
print("LOL. No chance!")
elif response == 2:
print("Maybe. See how I feel later.")
elif response == 3:
print("Ask Ricky.")
elif response == 4:
print("Sure... alright then.")
elif response == 5:
print("Ugh, if it has to.")
elif response == 6:
print("Nah.")
elif response == 7:
print("You go Glen Coco!")
elif response == 8:
print("I always knew you were a winner.")
else:
print("Boring question. Try again!")
play_again = str(input("Would you like to ask another question? yes/no ")).lower()
if play_again == 'no':
print("Bye, Felicia.")
sys.exit()