Method Overloading in Python (Hindi)

preview_player
Показать описание
Method Overloading in Python



Check Out Our Other Playlists:

SUBSCRIBE to Learn Programming Language !

Learn more about subject:

________________________________________________

If you found this video valuable, give it a like.
If you know someone who needs to see it, share it.
If you have questions ask below in comment section.
Add it to a playlist if you want to watch it later.
________________________________________________

T A L K W I T H M E !
_______________________________________________

Make sure you LIKE, SUBSCRIBE, COMMENT, and REQUEST A VIDEO! :)
_______________________________________________
Рекомендации по теме
Комментарии
Автор

We can use 0 (integer number) instead of None.
Sample: sum(self, a=0, b=0, c=0)

mfarzamalam
Автор

Great work bro
Nice voice with good mic and very simple Explanation
Very good

PramodSingh-kcne
Автор

Better to use 0 as default instead of None. This will remove all IFs.

TryCatch
Автор

class Myclass:
def sum(self, *args):
return sum(args)
Can we do this?

rahulsaha
Автор

Hii guys agar ham *args use kre to any number of numbers ko add kar sakte hai.


Code:-


class Myclass:
def sum(self, a=None, b=None, *args):
if a==None or b==None:
s='Provide At Least Two Numbers'
else:
s=a+b
if args:
for i in args:
s+=i
return s
obj=Myclass()
print(obj.sum())
print(obj.sum(10))
print(obj.sum(10, 20))
print(obj.sum(11, 20, 30))
print(obj.sum(11, 20, 30, 40))
print(obj.sum(11, 20, 30, 40, 50))


Output:-
Provide At Least Two Numbers
Provide At Least Two Numbers
30
61
101
151

satyam-seth
Автор

Bro Please make video lectures of Intro. To Algorithm and data structure alag alag

SanjayGupta-klxi
Автор

we can use 0 instead of None so we have to write less lines of code

davidak
Автор

Bro owsome video banaataa ahoo.
Voice fumble hootii hai. Thoori si voice clear hoo jaati toh Owsome hoo jata.

SHTALKS
Автор

Bro please make video of Django in sort time

rishadkhan
Автор

why you didn't write
def sum(a=0, b=0, c=0):
this work fine

sagarmehla
Автор

Bro how to stoare table data in a class

amolavhale
Автор

What if we want to pass more than three arguments?

vishalmaurya
Автор

PLEASE PLEASE PLEASE
HELP ME
Bhaiya can you please make a video on -->
How to connect python with sql
PLEASE PLEASE PLEASE
HELP ME

swapnilsingh
Автор

Sir appp mahine Mai 1 lakh v kama Leto ho coding se na ki utubese

rajkhanna
join shbcf.ru