hnc-eduard/HNS/Excercises/13082023 ДЗ по фигурам JSON/Rectangle.py

15 lines
310 B
Python

from Shape import Shape
class Rectangle(Shape):
def __int__(self, width, height, color):
self.width = width
self.height = height
self.color = color
def area(self):
return self.width * self.height
def perimetr(self):
return (self.width + self.height) * 2