Below you can see the abstract class EquilateralPolygon (it represents geometric shapes where all sides have the same length). Create a subclass Square. Do not forget to override the get_area method (it should return the area of the square).
Abstract classes
Polygon
Report a typo
Write a program in Python 3
from abc import ABC, abstractmethod
class EquilateralPolygon(ABC):
def __init__(self, side):
self.side = side
@abstractmethod
def get_area(self):
...
# create Square
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.