Operator Overloading

Operator overloading in Python is the ability of a single operator to perform more than one operation based on the type of operands. For example: the + operator performs addition on two numbers, merging two lists, or concatenate two strings or more strings.
Unary Operator | Method |
---|---|
+ | __pos__(self) |
- | __neg__(self) |