Question: Problem 1: Magic 8 Ball (25 points) Find the hw02_01.py file on Canvas. We have provided some code in that file to get you started

 Problem 1: Magic 8 Ball (25 points) Find the hw02_01.py file

Problem 1: Magic 8 Ball (25 points) Find the hw02_01.py file on Canvas. We have provided some code in that file to get you started on this problem. Specifically, you are given a function named magic_response that will return a string containing a random response from the Magic 8-Ball. Your task for this problem is to create a parameterless function called main that can be used to make queries to the Magic 8 Ball. You can add your code for this function to the given hw02_91.py file. When you call the function main (), the following things should happen: First the user will be prompted to ask a question: What would you like to ask the Magic 8-Ball? After the user inputs a question, a response is printed for the user (your code should get the response by calling the magic_response function) e.g.: It is certain. After printing the response, the user will receive a prompt to ask a question: What would you like to ask the Magic 8-Ball? If the user types goodbye in response to the prompt, the function will print goodbye and return nothing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!