Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

13. Are the sources of process variability recognised?

Answered: 1 week ago

Question

How organized or ready for action on this issue is this public?

Answered: 1 week ago

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago