Question: implement the class hierarchy shown below in a Python program that does the following: (both optional and abstract Use Shape as the abstract base class
implement the class hierarchy shown below in a Python program that does the following: (both optional and abstract
- Use Shape as the abstract base class with abstract method called area.
- Implement area method in Circle, Rectangle and Polygon subclasses by using appropriate types, return values (assume Polygon implements a regular simple polygon.)
- Write code that creates objects of the three subclasses and uses the area method to print the area of the shapes by passing any values of your choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
