forked from Graey/pythoncharmers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagicballgame.py
More file actions
38 lines (25 loc) · 772 Bytes
/
magicballgame.py
File metadata and controls
38 lines (25 loc) · 772 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
# Import the modules
import sys
import random
ans = True
while ans:
question = raw_input("Ask the magic 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"