Skip to content

Commit 9653b64

Browse files
committed
Sibiraj20
1 parent 2292c30 commit 9653b64

File tree

3 files changed

+31
-226
lines changed

3 files changed

+31
-226
lines changed

magic-8-ball.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import random
2+
import time
3+
4+
def magic_8_ball():
5+
answers = [
6+
"Yes",
7+
"No",
8+
"Ask again later",
9+
"Cannot predict now",
10+
"Don't count on it",
11+
"Most likely",
12+
"Outlook not so good",
13+
"Reply hazy, try again"
14+
]
15+
16+
print("Welcome to the Magic 8-Ball!")
17+
time.sleep(1)
18+
19+
while True:
20+
question = input("Ask me a yes-or-no question (or type 'exit' to end): ")
21+
if question.lower() == 'exit':
22+
print("Goodbye!")
23+
break
24+
25+
print("Shaking the Magic 8-Ball...")
26+
time.sleep(2)
27+
answer = random.choice(answers)
28+
print(f"The Magic 8-Ball says: {answer}\n")
29+
30+
if __name__ == "__main__":
31+
magic_8_ball()

requirements.txt

Lines changed: 0 additions & 113 deletions
This file was deleted.

requirements_with_versions.txt

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)