Question: Exercise 7.1 (shapes.py) Write a program that prompts the user for either circle or rectangle or square then reads in either the radius or width
Exercise 7.1 (shapes.py) Write a program that prompts the user for either "circle" or "rectangle" or "square" then reads in either the radius or width and height or the side length of the shape as floating point numbers. If a radius is given, the program should print the shape's circumference and area For a rectangle, print the perimeter and area. Here are some usage examples python3 shapes.py 2 Please enter a shape: circle 3 Please input the radius of the circle: 3 4 The circumference of the circle is 18.84955592153876 6 The area of the circle is 7 28.274333882308138 s $ python3 shapes.py 9 Please enter a shape: rectangle 10 Please enter the width of the rectangle: 10 11 Please enter the height of the rectangle: 3 12 The perimeter of the rectangle is 13 26 14 The area of the rectangle is 15 30 16 $ python3 shapes.py 17 Please enter a shape: square 18 Please enter the side length of the square: 10 9 The perimeter of the square is 20 40 21 The area of the square is 22 100
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
