Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE USE PYTHON CODE, THANK YOU. You are going to create a program that will mimic a Magic 8 Ball (toy used to predict the

image text in transcribedPLEASE USE PYTHON CODE, THANK YOU.

You are going to create a program that will mimic a Magic 8 Ball (toy used to predict the future) The Magic 8 Ball had the following 12 responses Yes, of course! Without a doubt, yes You can count on it For sure! Ask me later I'm not sure I can't tell you right now I'll tell you after my nap. No Way. I don't think so Without a doubt, no The answer is clearly NO Your program should have a main function and one other function that will create a list of responses The function that will create a list of responses should accept no parameters and return a list of 14 strings, the 12 given above plus two responses of your own. In this function, you should create an empty list, then use a loop to prompt the user to enter a string and append this string to the empty list. Once filled, the list should be returned to the function call Your main function should call the function to fill the list of responses. Prompt the user to enter a question. Then a random integer number between 0 and 13 (including 0 and 13) should be generated. Use this random number to determine a corresponding response from the list to the user's question. For example if the random number was 4, the corresponding response would be "Ask me later". Output both the user's question and the Magic 8 Ball response. Allow the user to continue asking the Magic 8 Ball a question as long as he/she would like

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions