I’ve been trying to get this concept of MyMagic8Ball to work, but it keeps saying something about +answer not being specified. Can someone please give me a example or a explatnation of what im doing wrong? code is below.
import random
ans1 = “Go for it!”
ans2 = “No way, Jose!”
ans3 = “I’m not sure. Ask me again.”
ans4 = “Fear of the unknown is what imprisons us.”
ans5 = “It would be madness to do that!”
ans6 = “Only you can save mankind!”
ans7 = “Makes no difference to me, do or don’t – whatever.”
ans8 = “Yes, I think on balance that is the right choice.”
anslist = [ans1, ans2, ans3, ans4, ans5, ans6, ans7, ans8]
print(“Welcome to MyMagic8Ball.”)
question = input(“Ask me for advice then press ENTER to shake me.n”)
print(“shaking …n” * 4)
answer = random.choice(anslist)
print(“My answer is: ” + answer)
submitted by /u/Beneficial-Part1930
[link] [comments]
r/learnpython I’ve been trying to get this concept of MyMagic8Ball to work, but it keeps saying something about +answer not being specified. Can someone please give me a example or a explatnation of what im doing wrong? code is below. import random ans1 = “Go for it!” ans2 = “No way, Jose!” ans3 = “I’m not sure. Ask me again.” ans4 = “Fear of the unknown is what imprisons us.” ans5 = “It would be madness to do that!” ans6 = “Only you can save mankind!” ans7 = “Makes no difference to me, do or don’t – whatever.” ans8 = “Yes, I think on balance that is the right choice.” anslist = [ans1, ans2, ans3, ans4, ans5, ans6, ans7, ans8] print(“Welcome to MyMagic8Ball.”) question = input(“Ask me for advice then press ENTER to shake me.n”) print(“shaking …n” * 4) answer = random.choice(anslist) print(“My answer is: ” + answer) submitted by /u/Beneficial-Part1930 [link] [comments]
I’ve been trying to get this concept of MyMagic8Ball to work, but it keeps saying something about +answer not being specified. Can someone please give me a example or a explatnation of what im doing wrong? code is below.
import random
ans1 = “Go for it!”
ans2 = “No way, Jose!”
ans3 = “I’m not sure. Ask me again.”
ans4 = “Fear of the unknown is what imprisons us.”
ans5 = “It would be madness to do that!”
ans6 = “Only you can save mankind!”
ans7 = “Makes no difference to me, do or don’t – whatever.”
ans8 = “Yes, I think on balance that is the right choice.”
anslist = [ans1, ans2, ans3, ans4, ans5, ans6, ans7, ans8]
print(“Welcome to MyMagic8Ball.”)
question = input(“Ask me for advice then press ENTER to shake me.n”)
print(“shaking …n” * 4)
answer = random.choice(anslist)
print(“My answer is: ” + answer)
submitted by /u/Beneficial-Part1930
[link] [comments]