Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
real base solution in Creative category for Building Base by veky
from collections import namedtuple
class Building(namedtuple("Base", "south west width_we width_ns height")):
east = property(lambda I: I.west + I.width_we)
north = property(lambda I: I.south + I.width_ns)
corners = lambda I: {y + "-" + x: (getattr(I, y), getattr(I, x))
for x in ("west", "east") for y in ("north", "south")}
area = lambda I: I.width_ns * I.width_we
volume = lambda I: I.area() * I.height
__repr__ = lambda I: I.__class__.__name__ + repr(tuple(I))
Building.__new__.__defaults__ = 10,
Nov. 5, 2014
Comments: