-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy path8balls-magic.py
More file actions
39 lines (28 loc) · 837 Bytes
/
8balls-magic.py
File metadata and controls
39 lines (28 loc) · 837 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
32
33
34
35
36
37
38
39
# Import the modules
import sys
import random
#how to improve such if else logic with contineous QA?
ans = True
while ans:
question = int(input("Ask the magic 8 ball a question: (press enter to quit) "))
answers = random.randint(1,8)
if question == "":
sys.exit()
elif answers == 1:
print("It is certain")
elif answers == 2:
print("Outlook good")
elif answers == 3:
print("You may rely on it")
elif answers == 4:
print("Ask again later")
elif answers == 5:
print("Concentrate and ask again")
elif answers == 6:
print("Reply hazy, try again")
elif answers == 7:
print("My reply is no")
elif answers == 8:
print("My sources say no")
else:
print("Wrong Input")