Skip to content

Fix magic8.py #1645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions magic8.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import random

name = "Joe"
question = "Will I win the lottery?"
answer = ""
Expand All @@ -6,25 +8,25 @@
# print(random_number)

if random_number == 1:
answer = "Yes - definitely"
answer = "Yes - definitely"
elif random_number == 2:
answer = "It is decidedly so"
answer = "It is decidedly so"
elif random_number == 3:
answer = "Without a doubt"
answer = "Without a doubt"
elif random_number == 4:
answer = "Reply hazy, try again"
answer = "Reply hazy, try again"
elif random_number == 5:
answer = "Ask again later"
answer = "Ask again later"
elif random_number == 6:
answer = "Better not tell you now"
answer = "Better not tell you now"
elif random_number == 7:
answer = "My sources say no"
answer = "My sources say no"
elif random_number == 8:
answer = "Outlook not so good"
answer = "Outlook not so good"
elif random_number == 9:
answer = "Very doubtful"
answer = "Very doubtful"
else:
answer = "Error"
answer = "Error"

print(name + " asks: " + question)
print("Magic 8 Ball's answer: " + answer)