-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmagic_8_ball.py
More file actions
31 lines (23 loc) · 811 Bytes
/
magic_8_ball.py
File metadata and controls
31 lines (23 loc) · 811 Bytes
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
# magic_8_ball.py
# Give the all knowing ball a shake
import random
import time
# Title
print("### MAGIC 8 BALL ###", end='\n\n')
def shake():
r = random.randint(0, 8) # Generate random num btw 0 & 8.
print("Shaking . . . ", end='\n\n')
# List of possible fortunes.
fortune_list = ["- It is certain",
"- It is decidedly so",
"- Yes",
"- Reply hazy try again",
"- Ask again later",
"- Concentrate and try again",
"- My reply is no",
"- Outlook not so good",
"- Very doubtful"]
time.sleep(5) # Add some suspense
return fortune_list[r] # Return reply
# Give it a go!
print(shake())