-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmagic8Ball
More file actions
46 lines (40 loc) · 1.27 KB
/
magic8Ball
File metadata and controls
46 lines (40 loc) · 1.27 KB
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
46
// In this Python3 Program, a user is able to make a Magic 8 Ball Produce Random Responses to questions.
// The User imports a random number picker from 1-11 and adds a response for each number selected.
// More review on Boolean Expressions, if elif else statements and how to import kits.
name = "Joe"
question = "Do you like cheese?"
answer = ""
import random
random_number= random.randint(1, 11)
# print(random) to check if properly working.
if random_number == 1:
answer = "Yes - Definitely"
elif random_number == 2:
answer = "It is decidedly so."
elif random_number == 3:
answer = "Without a doubt."
elif random_number == 4:
answer = "Reply hazy, try again."
elif random_number == 5:
answer = "Ask again later."
elif random_number == 6:
answer = "Better not tell you now."
elif random_number == 7:
answer = "My sources say no."
elif random_number == 8:
answer = "Outlook not so good."
elif random_number == 9:
answer = "Very doubtful."
elif random_number == 10:
answer = "Meh"
elif random_number == 11:
answer = "Reroll tbh"
else:
answer = "Error"
if name == "":
print(name + "asks: " + question)
else:
print("Question:" + question)
print("Magic 8-Ball's answer: " + answer)
if question == "":
print("How can I give you a fortune with no question?")