Exercise: shapes and areas
- Let’s implement a general class called
Shapeand two subclasses calledCircleandRectangle- Overload the
__eq__operator to compare the shapes’ areas - Override the constructor methods:
Rectangleshould havewidthandheight, andCircleshould haveradius - Write methods that calculate the areas of the shapes. When you have only the generic
Shapeobject, area should be equal to zero. - what about trying to implement the rendering of these shapes with turtle graphics?
- Overload the