I'm trying to write a method(it) that compares the size (area) of the rectangle with the area of another rectangle passed as a parameter:
class Rectangle: def __init__(self, x, y): self.width = x self.height = y def area(self): a = self.width * self.height return a def __it__(self,second): return self.area < second.area But I keep getting error:
TypeError: unorderable types: Rectangle() < Rectangle() I'm not to sure how to fix this problem