• Master Hun

"Magic 8 Ball" in Python

You can change/run the Python code for my "Magic 8 Ball" with the following link.

SoloLearn | Code Playground | Magic8Ball [Python]

Link: https://code.sololearn.com/ccqq14N4AAq0

The following Python code is my version of the classic "Magic 8 Ball":


Magic 8 Ball


import random

magic_8_ball_answers = [ "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." ]

print( "The Magic 8 Ball knows all." )

print( "The Magic 8 Ball has your answer: " )


print( "\"" + random.choice( magic_8_ball_answers ) + "\"" )


print( "Legal Disclaimer: The Magic 8 Ball does not any take responsibility for bad outcomes." )

print( "Take advice from a Magic 8 Ball at your own risk." )


print( "Coded by Master Hun | PythonFuMasters.com" )

38 views0 comments

Recent Posts

See All