Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Operator Overloading and Dunder methods in Python

In python, Operator overloading means giving an extended meaning to an operator beyond its native meaning. An example that comes to mind is the + operator. You must have noticed that it has several meaning depending on the type of its operands. If the operands are ints or floats, like in ‘2+3’ then the + operator means add both ints together, but if the operands are strings like in ‘dog’+’cat’

@emeka_david



This post first appeared on SOLVING IT?, please read the originial post: here

Share the post

Operator Overloading and Dunder methods in Python

×

Subscribe to Solving It?

Get updates delivered right to your inbox!

Thank you for your subscription

×