#59 Python Tutorial for Beginners | Operator Overloading | Polymorphism

  Рет қаралды 382,465

Telusko

Telusko

Күн бұрын

Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist : • #1 Python Tutorial for...
Python Tutorial in Hindi : • #1 Python Tutorial | I...
Check out our courses:
Java Full Stack and Spring AI - go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
DevOps with AWS: From Basics to Mastery : go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusk...
Github :- github.com/nav...
Editing Monitors :
amzn.to/2RfKWgL
amzn.to/2Q665JW
amzn.to/2OUP21a.
Check out our website: www.telusko.com
Follow Telusko on Twitter: / navinreddy20
Follow on Facebook:
Telusko : / teluskolearn. .
Navin Reddy : / navintelusko
Follow Navin Reddy on Instagram: / navinreddy20
Subscribe to our other channel:
Navin Reddy : www.youtube.co....
Telusko Hindi :
www.youtube.co....
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
www.telusko.com...

Пікірлер: 284
@mainakchakrabarti
@mainakchakrabarti 4 жыл бұрын
Sir your statement : "marks is not the way of comparing" won my heart
@utkarshachaudhari871
@utkarshachaudhari871 5 жыл бұрын
After so so many years, I have finally understood operator overloading!
@ankitakumari2756
@ankitakumari2756 4 жыл бұрын
😱😱😇
@tanishasethi7363
@tanishasethi7363 4 жыл бұрын
Exactly
@alimdeen6921
@alimdeen6921 4 жыл бұрын
Still i can't understand operator overloading 😔😓
@anindian4601
@anindian4601 3 жыл бұрын
@@alimdeen6921 YOU ARE RIGHT, THIS GUY Showing his nose after traveling through out the universe, actually he has to tell first simple example then he can show his vaast variety of expereince on us as beginners but directly he showing something else 99.9999999% from that the thing what we need is 0.0000000001% so its very confusing he did same for duck typing also
@abhisheksriramoju8772
@abhisheksriramoju8772 3 жыл бұрын
@@anindian4601 No, Actually his explanation is cool. He is explaining in the beginner point of view
@maneeshsingh2647
@maneeshsingh2647 5 жыл бұрын
"This is horrible way to compare two students by marks" I Love this line👍🙂
@HarjotSingh-rj2lf
@HarjotSingh-rj2lf 3 жыл бұрын
ikr
@dakshsingh6033
@dakshsingh6033 3 жыл бұрын
bro i also loved it so much!! what a quencidence
@moinafsana5945
@moinafsana5945 5 жыл бұрын
Since last Monday I have started to watching your videos . Now I am in #60.. , ultimately your teaching skill is too good . I have some basic core java knowledge, that's why I can catch up quickly and without you I couldn't go in depth in python.. thank you very much for sharing those materials . Appreciate your hard work.
@ankitajain2883
@ankitajain2883 5 жыл бұрын
He is probably the best instructor to learn from! He teaches with so much clarity! Hats off!
@sm07
@sm07 2 жыл бұрын
I was here to learn what operator overloading is. At the time of the end of the video, I learned about the structure and how the things behind the scene gonna work. Take a Bow Navin Sir.
@alicandonmez6748
@alicandonmez6748 5 жыл бұрын
You are a talented teacher! Happy that i've found you. Keep up the videos coming
@ShaheenPatan
@ShaheenPatan 10 ай бұрын
00:03 Operator overloading allows usage of operators with user-defined types like strings and classes. 02:02 Python uses methods to carry out operations like addition. 03:48 Operator overloading allows defining how operators work with user-defined classes. 05:36 Operator overloading allows us to define custom behavior for operators 07:28 Python allows operator overloading for custom classes 09:08 Operator overloading allows custom comparison of objects. 10:59 Operator overloading and polymorphism in Python 12:43 Operator overloading in Python allows us to customize the behavior of operators.
@madansirish9356
@madansirish9356 5 жыл бұрын
Excellent explanation I ever heard. You are amazing. Your teaching skills are at a peak. Impressed.
@sairajdas6692
@sairajdas6692 6 жыл бұрын
Wow I never knew about these double underscore function. Glad to learn new things from your channel. Thank you sir.
@surajjena1437
@surajjena1437 5 жыл бұрын
Thanks superhuman for this great explanation, right now I can feel what is happening behind the scene
@sarthakyadav9950
@sarthakyadav9950 3 жыл бұрын
Thanks for providing quality content for free it's better than most of the paid courses out there . You are just amazing.(:
@mbumbamwalila4224
@mbumbamwalila4224 4 жыл бұрын
Thanks, sir! from now on, you opened my eyes on what python can do. All confusions are gone from my head. I really understand python now.
@vasudevareddy5378
@vasudevareddy5378 5 жыл бұрын
One of the Good lecture, Students need teachers like you
@legenddairy8346
@legenddairy8346 3 жыл бұрын
Thanks!
@legenddairy8346
@legenddairy8346 3 жыл бұрын
My professor never explained what this even is, and just zoomed through this. Thanks for explaining so clearly! (I have subscribed!)
@motog9464
@motog9464 6 жыл бұрын
Awesome sir... Also being an educator, I can imagine how much effort you are putting in these videos.👍
@harshavardhandsh5190
@harshavardhandsh5190 5 жыл бұрын
How cruel are these language developer, can they not make this little easy....
@amongdoomers9464
@amongdoomers9464 5 жыл бұрын
@@harshavardhandsh5190 Python is easy thou
@RavikanthTalakoti
@RavikanthTalakoti 4 жыл бұрын
I can also see the effort you put in these videos, Navin sir. And today is my birthday Navin sir!
@Mushsayer
@Mushsayer 4 жыл бұрын
Clearly explained the concept of method overloading in Python. Thank you!
@arpitgupta4892
@arpitgupta4892 Ай бұрын
i have never returned disappointed from this channel thanks
@bandhanmondal4685
@bandhanmondal4685 3 жыл бұрын
this is the best channel on youtube to learn coding
@divyanshusingh6105
@divyanshusingh6105 4 жыл бұрын
Really I never understand this topic... But nowww i really know the meaning of operator overloading! Hats off to you sir🙌
@coolguy-zm7tn
@coolguy-zm7tn 8 ай бұрын
Great video, got lots to learn thank you so much 😊
@TM-ej9mr
@TM-ej9mr 3 жыл бұрын
Best Tutorial series in youtube ..........Love Sir
@neomuks
@neomuks 4 жыл бұрын
The way you explained the connection and flow behind the code was exceptionally well, your video increasing my knowledge of python exponentially.
@namansingh8081
@namansingh8081 5 жыл бұрын
Thnx very much I'm having exam tomorrow very nicely explained
@moinafsana5945
@moinafsana5945 5 жыл бұрын
Excellent Sir .. now I feel like a coder 😁
@Matrix_Mayhem
@Matrix_Mayhem Жыл бұрын
This video was very informative. Feels good to understand how magic methods works. Thanks Navin Sir!
@TheKapilsharma143
@TheKapilsharma143 3 жыл бұрын
After waching video in sequence this is the firts video i enjoy in diff way. ;)
@engineeringwithprogramming
@engineeringwithprogramming 4 жыл бұрын
Finally in this tutorial somethings I couldn't understand started making sense, thanks to this man!
@shrikarp7233
@shrikarp7233 4 жыл бұрын
Sir u literally thrown away my difficulty of understanding magical methods 🔥
@arihantjain4344
@arihantjain4344 4 жыл бұрын
Are concepts really so easy,or it's his teaching that's making them??
@Laith.Alkhazragy
@Laith.Alkhazragy 4 жыл бұрын
this is not so easy to understand, you did it also very quickly.. anyway thank u very much ..
@santhosha1312
@santhosha1312 2 жыл бұрын
Sir Your videos are like preparing tastiest Briyani and giving it as service for free 😃🥰🥰
@eliehaddad84
@eliehaddad84 2 жыл бұрын
This man is a genius 🙌
@EylulTurksever
@EylulTurksever 4 жыл бұрын
thank you for your amazing lessons sir. def __str__(self): return " ".join(map(str, [self.mark1, self.mark2]))
@vikaspal2799
@vikaspal2799 4 жыл бұрын
9:08 LEGEND!!!!!
@chinmayraut6058
@chinmayraut6058 4 жыл бұрын
what if we get many teacher like him . . . . . . . . . In no time INDIA will be a super developed country
@fathimathsameera9593
@fathimathsameera9593 3 жыл бұрын
Your classes are amazing...
@AyushSharma-be4kh
@AyushSharma-be4kh 4 жыл бұрын
Best Way one can teach ! Appreciative content.
@kaushalkishor4404
@kaushalkishor4404 3 жыл бұрын
No doubt, explanation is quite perspicuous. I am just curious how print(a+b+c) performed behind the scene because __add__ can add only two number Any Explanation/suggestion will be highly appreciated
@ihateracistandblackpeople4272
@ihateracistandblackpeople4272 2 жыл бұрын
it's too late but if you're still curious then variable length argument concept would be used in that case,you would accept the b,c in a list in the formal args and then perform the addition by using required mean like iteration etc
@054_ritesh3
@054_ritesh3 4 жыл бұрын
Print(S1.AMAZING,S1.AWSOME)
@tanaysamanta4730
@tanaysamanta4730 3 жыл бұрын
I ain't able to figure out the example of operator overloading :(
@kartickchandramanna267
@kartickchandramanna267 Жыл бұрын
Awesome lecture. Thank you sir 🙏
@subhamthemusicalguy8851
@subhamthemusicalguy8851 2 жыл бұрын
Excellent explanation
@Ihsan_almohsin
@Ihsan_almohsin 2 жыл бұрын
you are just awesome
@cokcury
@cokcury 4 жыл бұрын
hat's off guruji, im glad that people are aware about the marks comparison way, i aint a fan that way either. but as you said on youtube it might have reached a mass crowd...
@IrfanShaikh-lw8jl
@IrfanShaikh-lw8jl 4 жыл бұрын
In the code of addition def __add__(self, other): m1 = self.m1 + self.m2 m2 = other.m1 + other.m2 s3 = Student (m1, m2) This is correct
@khalidelgazzar
@khalidelgazzar 5 жыл бұрын
This is one hell of a great video! Thank you
@abdulmajidkz
@abdulmajidkz 3 жыл бұрын
This is good and just. Thank you.
@ravitejathumnoori1450
@ravitejathumnoori1450 6 жыл бұрын
sir, can you make videos on REST API using python
@raihankhanphotography6041
@raihankhanphotography6041 3 жыл бұрын
You're an awesome teacher!
@Shubham-1st
@Shubham-1st 6 жыл бұрын
I think below method is much more easy class A: def __init__(self,a): self.a = a def __add__(self,other): return self.a + other.a x = A(1) y = A(2) print(x+y) o/p = 3
@vibhashikhanna1864
@vibhashikhanna1864 5 жыл бұрын
can you also help for subtraction
@Shubham-1st
@Shubham-1st 5 жыл бұрын
@@vibhashikhanna1864 class A: def __init__(self,a): self.a = a def __sub__(self,other): return self.a - other.a x = A(3) y = A(2) print(x-y) o/p = 1
@vibhashikhanna1864
@vibhashikhanna1864 5 жыл бұрын
@@Shubham-1st thnx buddy
@vibhashikhanna1864
@vibhashikhanna1864 5 жыл бұрын
class A: def __init__(self,a): self.a = a def __add__(self,other): return self.a + other.a def _sub_(self,other): return self.a-other.a x = A(int(input("enter the number "))) y = A(int(input("enter the second number "))) print(x+y) x = A(int(input("enter the number "))) y = A(int(input("enter the second number "))) print(x-y) can youn help me with this...i wanna do it with operator overloading
@Shubham-1st
@Shubham-1st 5 жыл бұрын
@@vibhashikhanna1864 This program works well but you made a mistake with underscores. so use double underscores instead of single i.e. __sub__
@bhaveshmevada8424
@bhaveshmevada8424 6 жыл бұрын
Sir what next after this basic ?? Blockchain or advance python??
@rabilrbl
@rabilrbl 4 жыл бұрын
Great explaination! Its crystal clear for me now.
@tensfantasy2384
@tensfantasy2384 3 жыл бұрын
9:10 .....Golden Line 👏👏👏👌👌
@gouravchouhan1790
@gouravchouhan1790 3 жыл бұрын
That's who things should be taught, loved the way you created a some background
@mariaxia2687
@mariaxia2687 5 жыл бұрын
Thank you for uploading these awesome lectures, Sir. There's a typo in this video though. "Syntactic Sugar" instead of "Synthetic Sugar".
@vickyjha6839
@vickyjha6839 4 жыл бұрын
Thanks a lot sir you cleared my doubts
@surajkottayi2451
@surajkottayi2451 4 жыл бұрын
Just amazing 😊👍
@bhuvanaguna7782
@bhuvanaguna7782 5 жыл бұрын
thank you for your excellent class...I felt very very happy..thank you sir
@maheshvangala8472
@maheshvangala8472 3 жыл бұрын
Just Enjoyed It Thanks
@habibahmad9415
@habibahmad9415 4 жыл бұрын
Sir you are passing double values through s1 & s2 but it added only first values of both s1 & s2 ...my question is where second values has gone
@theanirudhroy
@theanirudhroy 3 жыл бұрын
I was looking in the comment section to see if anyone has asked this particular question, I have no idea what other people understood !
@MohitKumar-kh6mv
@MohitKumar-kh6mv 3 жыл бұрын
Awesome Awesome Awesome
@saviofernandes5263
@saviofernandes5263 4 жыл бұрын
At 1:24 it's supposed to be "Syntactic Sugar"
@leyanthreddy1436
@leyanthreddy1436 4 жыл бұрын
Really u r awesome sir
@indreeshpandey343
@indreeshpandey343 4 жыл бұрын
sir please bring up a series of python for intermediate where we can understand advance concepts of python.
@s.baskaravishnu22
@s.baskaravishnu22 5 жыл бұрын
your explanation is excellent
@sam.mankar
@sam.mankar 4 жыл бұрын
Sir ek aur video bana do operator overloading k upar... Apke sare tutorials samj gye, ye nhi smja
@milimishra6447
@milimishra6447 6 жыл бұрын
Ur python videos are awsmm.. watched all ur videos on python . waiting for next videos on python..pls keep making videos on python..thankuu sir
@Praveenkumar-wv8qy
@Praveenkumar-wv8qy 5 жыл бұрын
great sir again the imformation which will add some values in my life😍
@mohdsaif8423
@mohdsaif8423 2 жыл бұрын
Hi Naveen, what are the programs used in Product development Programs Kindly make video
@skrishnan9625
@skrishnan9625 4 жыл бұрын
*excellent teaching sir. i think I would get good marks in my 11th standard
@mysketchbook9630
@mysketchbook9630 6 жыл бұрын
Thanks Naveen, every time I go through your video, I thank you and your team.
@ROHIT-gv7xk
@ROHIT-gv7xk 5 жыл бұрын
nice video sir
@sriramasudhamsurachapudi6496
@sriramasudhamsurachapudi6496 Жыл бұрын
A small doubt: for math operation like +, - , * , we can understand which method will be called. How to know which way of calling maps to which builtin method? Eg. - How to know by calling print(a) will call __str__() ?
@Matrix_Mayhem
@Matrix_Mayhem Жыл бұрын
google or by reading document. You can search - print() function's magic/inbuilt method. like that
@jdranpariya3601
@jdranpariya3601 6 жыл бұрын
Hi sir will you teach advance python like networking with python etc...
@kenshinnanashi9469
@kenshinnanashi9469 5 жыл бұрын
These tutorials are great, but it would be a lot better to watch if the code in the background was a bigger font and/or more zoomed on, couse althought the content is awesome, you can hardly read the code it self.cheers
@pawnage3
@pawnage3 3 жыл бұрын
Thank you so much!
@bhaveshmevada8424
@bhaveshmevada8424 6 жыл бұрын
Sir please make step by step videos on interview preperation....
@wasimzaman674
@wasimzaman674 2 жыл бұрын
You are just a flame sir G
@kulamritbamrah4880
@kulamritbamrah4880 4 жыл бұрын
Actually, the __div__(self,other) magic method for operator (/) is only for Python 2.x. For Python 3.x -- as I have found -- the (/) operator call the __truediv__(self,other) magic method.
@bhetu_sagar
@bhetu_sagar 4 жыл бұрын
I love you bro!!! superb..
@BrighterWay
@BrighterWay 5 жыл бұрын
As useal greater explanation sir💯💯
@atharvsarathe540
@atharvsarathe540 3 жыл бұрын
also please explain the difference between data type and class. is int, list , str a class or are they data type?
@bhagyalakshmibadiginchala38
@bhagyalakshmibadiginchala38 5 жыл бұрын
I have a doubt about these statements will you please explain.. X+y is translated into x.__add__(y) If x has not implemented __add__ and x,y are of different types then y.__radd__(x) is called. There are equivalent "r" methods for all magic methods just mentioned.
@Chandalyt
@Chandalyt 4 жыл бұрын
Please make one more video on class and __init__
@mratanusarkar
@mratanusarkar 5 жыл бұрын
@Telusko, Sir, How to know the magic method used for an operator from pycharm itself? Sir, by your experience and knowledge you are saying that for "+" __add__ is used, for "print()" __str__ is being used, how do we know for a random operator/method, what magic method is being used in the background...so that we may overload it to our usage/preference??
@deepenpatel5403
@deepenpatel5403 5 жыл бұрын
Yes, I want to know the same.
@manojputhalapattu1469
@manojputhalapattu1469 5 жыл бұрын
press control and click on the operator you want to know to get MAGIC method
@krishnarout9176
@krishnarout9176 4 жыл бұрын
Double click "shift" and search magic method
@sass3842
@sass3842 Жыл бұрын
Thank you sir :)
@sreyadeb2673
@sreyadeb2673 4 жыл бұрын
For defining add or any operator in class can i use any other keyword like, for add __a__. Or for greater than __grt__??
@rakeshreddy1365
@rakeshreddy1365 4 жыл бұрын
yes u can
@subhankardas1789
@subhankardas1789 3 жыл бұрын
If we have two class, Class BookX: def __init__(self, pages) : self. pages=pages def __add__(self, other) : return self. pages+other.pages Class BookY: def __init__(self, pages) : self. pages=pages x=BookX(100) y=BookY(150) print("Total pages =", x+y) In this code why we are giving the add method in first class and why not in second class??
@user-rn6zc7vp3h
@user-rn6zc7vp3h 3 жыл бұрын
you can have in second class too you just need to change expression to y+x cuz first parameter has to be object of class BookY
@vyomchandragallani3645
@vyomchandragallani3645 6 жыл бұрын
why it is giving only one output in case of sum... i mean 118 and 134 should be there.... also if i want to get both sums what i has to write ?
@shivashishnaramdeo1712
@shivashishnaramdeo1712 6 жыл бұрын
while printing he has only written "s3.m1"..print "s3.m2" as well to get 134
@just_a_viewer5
@just_a_viewer5 2 жыл бұрын
it's actually "syntactic sugar" at 1:31
@abdulfareed2585
@abdulfareed2585 4 жыл бұрын
7:40 s3 = Student(m1,m2) What does the line mean? if we did not put that what will happen? I simply return m1,m2 !
@prakhargupta477
@prakhargupta477 3 жыл бұрын
Sir why we write ?? if r1 > r2: (why not >> if r1 < r2 ) return True else : return false
@unnatiagrawal8936
@unnatiagrawal8936 4 жыл бұрын
inside int class in add function self is argument which means add method is instance method.why we are able to call "int.add " it should be object.add()
@rushilmehta4415
@rushilmehta4415 4 жыл бұрын
How can we know which method is called in the behind if we use a specific operator?
@papreedhar8278
@papreedhar8278 6 жыл бұрын
Grt teaching sir..
@abhiseksingh6550
@abhiseksingh6550 6 жыл бұрын
Good learning point
@deepenpatel5403
@deepenpatel5403 5 жыл бұрын
Can we overload the '__add__' method multiple times inside the same class? (Each method having its own different code)
@prafulgopal9656
@prafulgopal9656 3 жыл бұрын
you have told the add method takes two arguemets, what if we have to add more than two?
@raghavagarwal3163
@raghavagarwal3163 4 жыл бұрын
Can we directly import sum of marks i.e. m1 and m2 from add method and check them in greater than method instead of again adding marks?
#64 Python Tutorial for Beginners | MultiThreading
14:45
Telusko
Рет қаралды 455 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
OOP in Python | Object Oriented Programming
1:45:19
Telusko
Рет қаралды 1,8 МЛН
#44 Python Tutorial for Beginners | Decorators
7:33
Telusko
Рет қаралды 629 М.
Please Master This MAGIC Python Feature... 🪄
25:10
Tech With Tim
Рет қаралды 173 М.
#63 Python Tutorial for Beginners | Exception Handling
15:59
Telusko
Рет қаралды 548 М.
Abstract Class and Abstract Method in Python
12:29
Telusko
Рет қаралды 379 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 274 М.
Method Overloading and Method Overriding| Python Tutorials for Beginners #lec105
17:46
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 187 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 68 М.