14 lines
222 B
Python
14 lines
222 B
Python
|
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
|