hnc-vitalii/HNS/Excercises/27.08.2023/Rectangle.py

14 lines
222 B
Python
Raw Permalink Normal View History

import Shape
class Rectangle(Shape):
def __init__(self, w, h):
self.w = w
self.h = h
def perimeter(self):
return 2 * (self.w + self.h)
def area(self):
return self.w * self.h