An Abstract Shape
Python
20 pts
An Abstract Shape
Make Shape an abstract class with an abstract method area(self). Then give Rectangle its own area() method that returns width × height.
The code at the bottom is ready. Expected output:
Area: 20
Checklist
- Make
Shapean abstract class with an abstract methodarea(self). - Make
Rectanglea child ofShapewith its ownarea()that returns width × height. - Run the code at the bottom.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
