Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
One of many faceless decisions solution in Clear category for Building Base by samatdav02
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 "Building({0}, {1}, {2}, {3}, {4})".format(
self.south,
self.west,
self.widthWE,
self.widthNS,
self.height
)
June 27, 2019
Comments: