๐ŸŽฏDesigning with Interfaces via ProtocolWORKSHOP
1
2
3
4
5

Step 1

Define a `Shape(ABC)` abstract base class with two abstract methods: `area(self) -> float` and `perimeter(self) -> float`. Then implement two concrete subclasses: `Circle(Shape)` with a `radius` attribute, and `Rectangle(Shape)` with `width` and `height`. Import `math` for `math.pi`.

โŒ˜ Enter (Mac) ยท Ctrl+Enter (Win/Linux)