Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started