Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Building Base by Hanna_Hofman
class Building:
def __init__(self, south, west, width_WE, width_NS, height=10):
self.init_params = [south, west, width_WE, width_NS, height]
east = west+width_WE
north = south+width_NS
self.corners_dict = {"north-west": [north,west], "north-east": [north,east], "south-west": [south,west], "south-east": [south,east]}
self.height = height
self.width = width_WE
self.length = width_NS
def corners(self):
return self.corners_dict
def area(self):
return self.width*self.length
def volume(self):
return self.area()*self.height
def __repr__(self):
return 'Building('+str(self.init_params)[1:-1:]+')'
Nov. 8, 2014