-
Notifications
You must be signed in to change notification settings - Fork 0
/
8-ball.py
51 lines (48 loc) · 1.21 KB
/
8-ball.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
46
47
48
49
50
51
print("Hello and welcome to the 8-Ball. Please answer the questions and get your foturne!")
print("Enter your name")
name = input()
print("Ask your YES/NO question")
question = input()
answer = ""
import random
random_number = random.randint(1, 9)
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."
else:
answer = "Error"
if question == "":
print("Error: Please ask a question")
question = input()
if question == "":
print("Really, Please ask a question!")
question = input()
if question == "":
print("Fine, don't ask anything! - BYE")
quit()
if name == "":
question = "Question: " + question
else:
question = name + " has asked, " + question
print("...")
print(question)
print("...")
print("8-ball thinks")
print("...")
print(answer)
print("...")