class Rectangle: def __init__(self, x1, y1, x2, y2): # find the lower left hand corner if x2 < x1: x1, x2 = x2, x1 if y2 < y1: y1, y2 = y2, y1 self.x = x1 self.y = y1 self.width = x2 - x1 self.height = y2 - y1 def area(self): return self.width * self.height