Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Building Base by UFO665
class Building:
def __init__(self, south, west, width_WE, width_NS, height=10):
self.south = south
self.west = west
self.widthWE = width_WE
self.widthNS = width_NS
self.height = height
def corners(self):
return {"north-west": [self.south + self.widthNS, self.west],
"north-east": [self.south + self.widthNS, self.west + self.widthWE],
"south-west": [self.south, self.west],
"south-east": [self.south, self.west + self.widthWE]}
def area(self):
return self.widthWE * self.widthNS
def volume(self):
return self.area() * self.height
def __repr__(self):
return "{}({}, {}, {}, {}, {})".format(
self.__class__.__name__, self.south, self.west, self.widthWE, self.widthNS, self.height)
Dec. 4, 2015