From 056719ff09097d3451c52e19d3f3c4dbcb1fa6ab Mon Sep 17 00:00:00 2001 From: pallavi1428 <66426702+pallavi1428@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:08:33 -0700 Subject: [PATCH] Update 8balls-magic.py --- 8balls-magic.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/8balls-magic.py b/8balls-magic.py index 956c2cc..9e25e58 100644 --- a/8balls-magic.py +++ b/8balls-magic.py @@ -5,7 +5,7 @@ ans = True while ans: - question = raw_input("Ask the magic 8 ball a question: (press enter to quit) ") + question = int(input("Ask the magic 8 ball a question: (press enter to quit) ")) answers = random.randint(1,8) @@ -13,25 +13,27 @@ sys.exit() elif answers == 1: - print "It is certain" + print("It is certain") elif answers == 2: - print "Outlook good" + print("Outlook good") elif answers == 3: - print "You may rely on it" + print("You may rely on it") elif answers == 4: - print "Ask again later" + print("Ask again later") elif answers == 5: - print "Concentrate and ask again" + print("Concentrate and ask again") elif answers == 6: - print "Reply hazy, try again" + print("Reply hazy, try again") elif answers == 7: - print "My reply is no" + print("My reply is no") elif answers == 8: - print "My sources say no" + print("My sources say no") + else: + print("Wrong Input")