import time
generate = random.randint(1,20)
userQ = input("Welcome to Magic 8 ball, ask me anything!\n")
print("*Shaking ball*")
time.sleep(2)
if generate == 1:
print("It is certain")
elif generate == 2:
print("It is decidedly so")
elif generate == 3:
print("Without a doubt")
elif generate == 4:
print("Yes definitely")
elif generate == 5:
print("You may rely on it")
elif generate == 6:
print("As I see it, yes")
elif generate == 7:
print("Most likely")
elif generate == 8:
print("Outlook good")
elif generate == 9:
print("Yes")
elif generate == 10:
print("Signs point to yes")
elif generate == 11:
print("Reply hazy try again")
elif generate == 12:
print("Ask again later")
elif generate == 13:
print("Better not tell you now")
elif generate == 14:
print("Cannot predict now")
elif generate == 15:
print("Concentrate and ask again")
elif generate == 16:
print("Don't count on it")
elif generate == 17:
print("My reply is no")
elif generate == 18:
print("My sources say no")
elif generate == 19:
print("Outlook not so good")
elif generate == 20:
print("Very doubtful")
time.sleep(0.5)
while True:
generate = random.randint(1,20)
userQ = input("Ask me another question (to exit say ¦put down 8 ball¦)\n")
print("*Shaking ball*")
time.sleep(2)
if generate == 1:
print("It is certain")
elif generate == 2:
print("It is decidedly so")
elif generate == 3:
print("Without a doubt")
elif generate == 4:
print("Yes definitely")
elif generate == 5:
print("You may rely on it")
elif generate == 6:
print("As I see it, yes")
elif generate == 7:
print("Most likely")
elif generate == 8:
print("Outlook good")
elif generate == 9:
print("Yes")
elif generate == 10:
print("Signs point to yes")
elif generate == 11:
print("Reply hazy try again")
elif generate == 12:
print("Ask again later")
elif generate == 13:
print("Better not tell you now")
elif generate == 14:
print("Cannot predict now")
elif generate == 15:
print("Concentrate and ask again")
elif generate == 16:
print("Don't count on it")
elif generate == 17:
print("My reply is no")
elif generate == 18:
print("My sources say no")
elif generate == 19:
print("Outlook not so good")
elif generate == 20:
print("Very doubtful")
time.sleep(0.5)
if userQ == "put down 8 ball":
break
No comments:
Post a Comment