Python __add__() Syntax
Syntax: obj1.__add__(self, obj2)
- obj1: First object to add in the second object.
- obj2: Second object to add in the first object.
Returns: Returns a new object representing the summation of the other two objects.
Python __add__() magic method
Python __add__() function is one of the magic methods in Python that returns a new object(third) i.e. the addition of the other two objects. It implements the addition operator “+” in Python.