Python - Magic Methods and Operator Overloading
What will be the output of this code?
class Counter:
def __init__(self, count):
self.count = count
def __add__(self, other):
return Counter(self.count + other.count)
def __str__(self):
return str(self.count)
c1 = Counter(3)
c2 = Counter(4)
c3 = c1 + c2
print(c3)