operator overloading in python by R4R Team

-operator overloading is a concept in which a operator is perform multiple task.

Example-

'+'operator in python.

2+3 will give 5
'text'+'Text' will give 'textText'

'*' operator in python

2*3 will give 6
'text'*3 will give texttexttext

-So from above example, we can conclude that by operator overloading, operator may able to perform multiple task.


program-

print(2+3)
print("text"+"Text")
print(2*3)
print("text"*3)


output-

5
textText
6
texttexttext




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!