Question: As you know from basic geometry, each shape has its own area formula. Let's write a python function that will provide the area for the

 As you know from basic geometry, each shape has its own

As you know from basic geometry, each shape has its own area formula. Let's write a python function that will provide the area for the following basic shapes: sphere, triangle, rectangle and circle. Depending on the shape specified by the user, the function will be asking the user to input the associated values needed to calculate the area, then prints out the value of the calculated area. When you execute your code you will get the following message: Which shape are you interested in? Assuming the user inputs "sphere" as an answer, the program should now ask the user to input the value of the radius: Please enter the value of the radius: Then the calculated area will be printed out to the screen: The area of a sphere of radius value is value Here are some examples as executed in Wing 101: Example 1: Which shape are you interested in: sphere Please enter the radius of the sphere: 5 The area of a sphere of radius 5.0 is 314.1592653589793 Example 2: Which shape are you interested in: ellipse You have entered an invalid shape name. Only the following shapes are supported: sphere, triangle, rectangle or circle

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!