Python Projects: Magic 8 Ball for fortune-telling or seeking advice
Python Project-5 with Solution
Create a Python project of a Magic 8 Ball which is a toy used for fortune-telling or seeking advice.
Note :
- Allow the user to input their question.
- Show an in progress message.
- Create 10/20 responses, and show a random response.
- Allow the user to ask another question/advice or quit the game.
Sample Solution -1 :
Python Code:
Output:
__ __ _____ _____ _____ ___ | \/ | /\ / ____|_ _/ ____| / _ \ | \ / | / \ | | __ | || | | (_) | | |\/| | / /\ \| | |_ | | || | > _ < | | | |/ ____ \ |__| |_| || |____ | (_) | |_| |_/_/ \_\_____|_____\_____| \___/ Hello World, I am the Magic 8 Ball, What is your name? Sara hello Sara Ask me a question. Tell my fortune It is certain I hope that helped! Do you have another question? [Y/N] Y Ask me a question. My favorite color My reply is no I hope that helped! Do you have another question? [Y/N] N
Flowchart:

Sample Solution -2 :
Python Code:
Sample Output:
You may ask your yes or no question of the Magic 8 Ball! Tell me my fortune Thinking... You may rely on it Would you like to ask another question? (Y or N)Y You may ask your yes or no question of the Magic 8 Ball! yes Thinking... Yes, definitely Would you like to ask another question? (Y or N)n Come back if you have more questions!
Flowchart:

Sample Solution -3 :
99 bottles of beer...
Python Code:
Sample Output:
Hello user. How many questions would you like to ask the 8-Ball? 1 Type your question: Tell me my fortune Signs point to yes. I hope you liked the answer(s). THE GREAT 8-BALL HAS SPOKEN!
Flowchart:

Sample Solution -4 :
Python Code:
Sample Output:
Welcome to the Magic 8-Ball. Enter your question: Tell me my fortune Thinking... 3... 2... 1... Maybe not. Would you like to ask another question? yes/no yes Welcome to the Magic 8-Ball. Enter your question: My favorite color Thinking... 3... 2... 1... No. Would you like to ask another question? yes/no no Goodbye! Thanks for playing!
Flowchart:

Contribute your code and comments through Disqus.