#
# Magic 8 ball program
#
# Import the modules
import sys
import random as random

while True:
    question = input("Ask the magic 8 ball a question: (press enter to quit) ")
    answers = random.randint(1,8)
    
    if question == "":
        sys.exit()
    
    elif answers == 1:
        print ("It is certain")
    
    elif answers == 2:
        print ("Outlook good")
    
    elif answers == 3:
        print ("You may rely on it")
    
    elif answers == 4:
        print ("Ask again later")
    
    elif answers == 5:
        print ("Concentrate and ask again")
    
    elif answers == 6:
        print ("Reply hazy, try again")
    
    elif answers == 7:
        print ("My reply is no")
    
    elif answers == 8:
        print ("My sources say no")

# Exercise: Is there a way to simplify this program by getting rid of if-else statements?
# Hint :    use list below which includes all 8 ball answers 
# answer_list = ['it is certain','It is decidedly so','Without a doubt','Yes, definitely','You may rely on it','As I see it, yes','Most likely','Outlook good','Yes','Signs point to yes','Reply hazy try again','Ask again later','Better not tell you now','Cannot predict now','Concentrate and ask again','Don't count on it','My reply is no','My sources say no','Outlook not so good','Very doubtful']
