Loading...
Implement a class hierarchy for shapes.
Inheritance allows classes to share behavior:
class Child(Parent):
def __init__(self):
super().__init__()
Create an inheritance hierarchy:
Base class Shape with:
Rectangle(Shape) with:
Circle(Shape) with:
Rectangle(4, 5)
Rectangle: area=20
4 * 5 = 20