Python - Magic Methods and Operator Overloading
What will be the output of this code?
class Box:
def __init__(self, volume):
self.volume = volume
def __lt__(self, other):
return self.volume < other.volume
b1 = Box(10)
b2 = Box(20)
print(b1 < b2)