0% found this document useful (0 votes)
58 views

Python Overloading

This document discusses overloading in Python by providing three examples. The + operator can be used for arithmetic addition and string concatenation. The * operator can be used for multiplication and string repetition. A deposit() method can be used to deposit cash, cheque, or demand draft into a bank account.

Uploaded by

d2op
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Python Overloading

This document discusses overloading in Python by providing three examples. The + operator can be used for arithmetic addition and string concatenation. The * operator can be used for multiplication and string repetition. A deposit() method can be used to deposit cash, cheque, or demand draft into a bank account.

Uploaded by

d2op
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Overloading


Eg 1: + operator can be used for Arithmetic addition and String
concatenation

print(10+20)#30
 print('durga'+'soft')#durgasoft

Eg 2: * operator can be used for multiplication and string repetition
purposes.

print(10*20)#200
 print('durga'*3)#durgadurgadurga

Eg 3: We can use deposit() method to deposit cash or cheque or dd
 deposit(cash)

deposit(cheque)

You might also like