Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
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