|
from shape import Shape
|
|
|
|
|
|
class Rectangle(Shape):
|
|
def __init__(self, width, height):
|
|
self.width = width
|
|
self.height = height
|
|
|
|
def area(self):
|
|
return self.width * self.height
|
|
|
|
def perimetr(self):
|
|
return (self.width + self.height) * 2
|
|
|
|
|
|
r1 = Rectangle(10, 20)
|
|
print(r1.area())
|