DuPont Interview Question

What is operator overloading in python?

Interview Answer

Anonymous

Mar 21, 2017

The operators are actually methods defined in respective classes. Defining methods for operators is known as operator overloading. For e.g. To use + operator with custom objects you need to define a method called __add__ .