In [ ]:
# from IPython.display import clear_output #Used to clear the page of text
from random import randint #gets random generator
from time import sleep #Used to break the code

dumbanswers = ("As I see it, yes.",
      "Ask again later.",
      "Better not tell you now.",
      "Cannot predict now.",
      "Concentrate and ask again.",
      "Don’t count on it.",
      "It is certain.",
      "It is decidedly so.",
      "Most likely.",
      "My reply is no.",
      "My sources say no.",
      "Outlook not so good.",
      "Outlook good.",
      "Reply hazy, try again.",
      "Signs point to yes.",
      "Very doubtful.",
      "Without a doubt.",
      "Yes.",
      "Yes",
      "definitely.",
      "You may rely on it.")
#the awnsers to the questions

def magic8ball(): #The interface for the magic 8 ball

   question = input("input the question you have") #Questions
   if question == "": #Just in case the user puts in nothing
       print("Keep your secrets, I know them and shall answer them") #Text to remind them they did nothing, funny harry potter refrence

   sleep(randint(1, 20)) #how long the break will last
   print(dumbanswers[randint(0,21)]) #Anwers


   

#Menue
def menu():


    while True: #So we can get the question and leaving it
        print("Welcome to the pay Magic 8 Ball")
        print("What do you want to do?")
        print("put in 1 for your questions.")
        print("Put in 2 if you want to exit")
 
        menuChoose = input("1 or 2") #The choose between 1 or 2

        if menuChoose == "1": #When you want the questions anwered
            magic8ball()
        elif menuChoose == "2": #When you don't want it anwered
            print("Have a good day") #Have a good day after you leave the 8 ball
            break

        else: #Just in case they put 30, 3 or 12
            print("Invalid choose, choose 1 or 2")
            input("Press enter")
            clear_output()

if __name__ == "__main__":
    menu()

    

         
Welcome to the pay Magic 8 Ball
What do you want to do?
put in 1 for your questions.
Put in 2 if you want to exit
Keep your secrets, I know them and shall answer them
It is certain.
Welcome to the pay Magic 8 Ball
What do you want to do?
put in 1 for your questions.
Put in 2 if you want to exit
In [ ]: