• Wrong Chech


I would like to give some feedback about ...

From: http://www.checkio.org/mission/building-base/solve/


Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

I believe the Check on the Corners method for the Building Class is not correct. I wrote the following:

class Building: def init(self, south, west, widthWE, widthNS, height=10): self.south = south self.west = west self.widthWE = widthWE self.widthNS = widthNS self.height = height

def corners(self):
    result = {}
    result["south_west"] = (self.south, self.west)
    result["north_east"] = (self.south + self.width_NS, self.west + self.width_WE)
    result["south_east"] = (self.south, self.west + self.width_WE)
    result["north_west"] = (self.south + self.width_NS, self.west)

    return result

def area(self):
    return self.width_NS * self.self_width_WE

def volume(self):
    return self.area * self.height

def __repr__(self):
    string = "Building({}, {}, {}, {}, {})".format(self.south, self.west, self.width_WE, self.width_NS, self.height)
    return string

As I said, the Corners check fails. However, I dont understand why.