For any queries you can reach us at infovistarindia@gmail.com / WhatsApp us: +919158876092

Python Operator Overloading

Operator Overloading

Python 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)