In [ ]:
#I'm importing this so I can choose things at random
from random import randint

#I'm importing this so the screen can clear it self
from IPython.display import clear_output

#'m importing this so the 8ball can wait a few seconds before answering'
from time import sleep

#These are just all the different types of answers you will recieve from the 8ball
answers = ["Nah, definitely not", "Nope, not happening", "There’s absolutely no way", "Nope!!", "No, Just no", "Nah", "Yikes, it's not looking like a yes", "I have good news for you, NO", "After careful consideration, I, the program has decided it’s a no, sorry", "Ye-... actually, no", "You’re in luck, Yes!!", "Yep", "100% Yes, no doubt in my database", "Yes", "Sure", "Seems like a yes to me!", "I have some pretty bad news for you, it’s a Yes!", "Yknow, that doesn’t sound like a horrible idea. Sure, why not", "Yuh", "Yessir!"]

#Just a quick function set up so it would ask the user if they would like to go again
def leave():
    yourAnswer = input("Would you like another wise response? y for yes or n for no 👉 ")
    if yourAnswer == "Y" or yourAnswer =="y":
        main()
    elif yourAnswer == "N" or yourAnswer == "n":
        clear_output()
        print("Damn... Comeback if you have any other questions!!!")
    else:
        leave()
        
def main():
    
    #This makes it seem like the program is thinking long and hard before answering the user.
    napTime = randint(3, 5)

    #This is just choosing an answer from random from the answers up there
    ranAnswer = randint(0,19)
    
    #Nice, welcoming startup
    question = input("Tell me any question you have on your mind, I answer everything with 100% accuracy i gurantee it 👉")
    
    #If the user puts an answer as blank, the program will tell them they can't do that.
    if question == "":
        question = "Bro did you really put nothing? I can't answer that xD"
    
        #This right here just clears the screen             
    clear_output()
       
        #Like before, this just makes it seem like the program is thinking long and hard about your question. Lasts 2-5 seconds.
    print("Give me one sec...")
                     
    #This just allows the program to make it think for 2-5 seconds               
    sleep(napTime)
                     
    clear_output()
     
        #This will print out your answer
    print("{} \n".format(question))
    print(answers[ranAnswer])
                     
    leave()
                     
main()
Is it gonna snow tomorrow? 

Yes
In [ ]: