Exercise: shapes and areas
- Let’s implement a general class called
Shape
and two subclasses calledCircle
andRectangle
- Overload the
__eq__
operator to compare the shapes’ areas - Override the constructor methods:
Rectangle
should havewidth
andheight
, andCircle
should haveradius
- Write methods that calculate the areas of the shapes. When you have only the generic
Shape
object, area should be equal to zero. - what about trying to implement the rendering of these shapes with turtle graphics?
- Overload the