OMG, This course is far better than other paid course. I may sound like an agent of Telusko or Naveen, but the course is designed specifically as per the need of the users. Most of the time we come across the videos where the contents are limited by the knowledge of the presenter or speaker and even the speaking ability of the teacher determines the quality of a course. But this playlist on python is amazing. Complete package. Naveen not only having the enormous amount of knowledge but also his speaking and verbal ability is of sky high level. Thanks a lot. Ahhhh, Forgot 1 thiing, The way the deliver the final word "BYE" in the Shahrukh style. Its cherry on the cake.
I was actually worst at coding. But after reaching till this point of this playlist I've already surpassed many of my classmates. After telling them I have learned this for free, they were shocked and even they have started learning from your course. Thank you
Thank you for free course I’m continuing watching your course series It’s very helpful I have decide I’ll never purchase online course As long as teacher like you are teaching for free Thank you sir 🙏🙏🙏
english is my 3rd language so it's a bit harder for me to understand, but this guy explains it so good that im not having a hard time trying to understand what he says. what im trying to say is that i like this chanel and its better than payed courses.
I have changed my google search on python to like multithreading in python telusko ... Ha ha I now add telusko in every python topic search ... Great lectures
Thank you for this. I am back here after so many days just to say thanks... So I had learnt python from this playlist in lockdown, and I am so grateful that I did it. I must say this has helped a lot. Lots of thanks for such videos ☺
Thank you very much , I am not able to understand this concept properly you help me made it. But I will also prefer to read python documentation to understand concept more properly after videos😊👌
Great video. I have a question though... when you say MRO is left to right, is this because the call to Class(A,B) reads A first (as it is on left)... if we swap them around to Class(B,A) will it pick B first? Or is there some other abstract thing at play here... order of top to bottom? What if we swapped Class A and Class B around, so Class B was at the top?
Sir thanks a lot because you have provided a very useful and free of cost course which helped us to get our goals. Even this course is better than other paid courses. You helped us to save our future, You are a "Super Hero" sir. May God Bless You.
If Possible, Please conduct live session on python programming in this weekend Naveen sir. It will very helpful to revise what we're learn. Really, enjoy the session, clearly understand inheritance concepts -> single-level, multi-level & Multiple Inheritance super() method usage, __init__ constructor and Method Resolution Order in inheritance. Best python teacher ever in my life. anyone want to do python crash course with-in 1 month, it is very helpful. I have storage testing background, this course very helpfully for my career. All of my colleagues are fan of you sir.
loved the music in the beginning.....i think you should make the video with the music slightly playing in low volume in the background...will make it more interesting....one thing is that it might distract people from paying attention on what you are speaking....but i've seen videos in which they narrate with music in the background and it works.
Another great video. May I suggest a new idea for future videos? A series of videos (or a longer one) building something small (maybe using TkInter, plotly, etc)
Excellent explanation. Due to MRO, this is printing init of Class A, how to print init of class B without changing (A, B) to (B, A) in Class C and do not want to print class A init. (pls note that, adding super in each class, print init in for all classes, I am looking to print for Class B only)
It's very nice vedio. you are are saying that in multiple inheritance it follows the left to right order.In c(A,B) if we want to call any method from c in b then how to call.
Almost perfect. One question is left over: How can use access methods of B from class C(A, B) !!! I really insist on that question, because it will ruin all the reasoning behind the multiple inheritance...
Hi Navin, I couldn't understand , even if we don't specify the constructor in B it will call default constructor of B if we define object B. But then ,why Object of B calls constructor of A if don't specify the constructor of B. Please reply.
Two very very important question from this video...please answer this...I think it may be the question for majority of us 1) why the object of bast class is not created by default or constructor is not called by default as in c++ or Java does?? 2) how to call constructor of all the base class in case of multiple inheritance?
In the case of duplicate methods between parent classes, using super() will not take any arguments to choose which to use, and will always go from left to right as you list them when defining the child class. ie. C(A, B) will pull from A in the case of duplicates, and C(B, A) will pull from B in the case of duplicates. In the case of duplicate methods between parent classes, you can choose which of the parent classes to use a method from by explicitly calling the method within the child class. Instead of using super().method() you can decide which instance of the duplicate to use by naming it explicitly. If your class inherits A before B, like in C(A, B), but you want to use a method from B that also exists in A, use B.method() to use it. super(). looks like a good shortcut for when you know you will not be dealing with choosing between duplicates, and you don't want to explicitly mention which class to call from.
Sir,I am studying in first year engineering and i have learned 70% python and also did your lectures and i have to do project of iot which require kivy library to make app and i should learn it and i also want to prepare for college placement which requires c or jawa So,how can i plan for programming for 4 years of engineering? And should i start with c or not?
learning python without c ....is ok.. you can ....but c is the basics of every language ..it gives you primary idea about coding so learn c first then try to learn C++ because you will cover max oops concepts there then go on to java .....after that pick up one language either c++ java or python and do practicng coding on codechef...so you will increase your coding skills day by day...
Hi Navin, Regarding what you explained at 8:04 Hi Navin, I have a question. Imagine I have two classes, A and B. In class A, I have class variable and class method. Now I want to access class variable and method from class A inside one of the the instance methods of class B. To access class method, I found that (after inheritance), I can access via using self. or A. or super(). Is there any advised way to choose among those three options?
when class C(A,B) it will always fetch the values of A ie left to right even though you call super().__init__() multiple times. for accessing the values of B you should write C(B,A) then it will fetch the values of B. Thats the rule of MRO...
you can access class B constructor...in this code super(A, self).__init__() NB:-i don't know the working methodology of this code. But this code is working ..
class GrandparentClass: def __init__(self): print ("init of GrandparentClass") def Feature1(self): print (" Feature 1") class ParentClass: def __init__(self): print ("init of ParentClass") def Feature1(self): print (" Feature 2") class SubClass(GrandparentClass,ParentClass): def __init__(self): super().__init__() print ("init of SubClass") def Feature1(self): print (" Feature 3") sub=SubClass() This Code Works fine for any Python 3 Editor. Avoid using Python2
Class C(A,B)--- Prints only the __init__ method from Superclass Class A, but ClassC(B,A) prints the _init_ method from both Superclasses A and B. Explain please.
Class A = Have the defined constructor Class B = does not have any defined constructor When a = B(), on the video you told it would access the Class A Constructor only and Class B does not have any defined Constructor. My question, in Class B, by default there would be an empty constructor like below, def __init__(self): pass So, it would look for B class __init__ right? OR is this going to B class __init__ pass the B constructor and move to A?
Sir when I was doing this programme output is not coming ..It is written that " Cannot create a consistence method resolution order for base A And B" ...Help me plzzz
You must be inheriting the class A into the class B , while using the Multiple Inheritance level like this : class A: def me(self): print("Feature 1") class B(A): //like this : Inheriting the class A def me(self): print("Feature 2") class C(A,B): def me(self): print("Feature 3") c1 = C() c1.me() ____________In order to resolve the MRO error , you can try this (below):______________ class A: def me(self): print("Feature 1") class B:
class A: def __init__(self): print("init A") def feature_1(self): print("i am a feature 1") def feature_2(self): print("i am a feature 2") class B: def __init__(self): print("init B") super().__init__() def feature_3(self): print("i am a feature 3") def feature_4(self): print("i am a feature 4") class C(B, A): def __init__(self): print("init c") super().__init__() def feature(self): super().feature_1() c_obj = C() In above code C is inherit from B and A and I have created object of class C which call __init__ method of C and super().__init__ method of C class is calling __init__ of B method(Absolutely fine as per MRO) and I have not inherit B class from A class but super().__init__ method of B class is calling __init__ method of A class. Can alnybody please explain how it is possible without inheriting the class from another class it is calling the constructor of that class. Belwow is the output for your reference init c init B init A
if you write "class C(B):" only then it is not calling __init__ of A. It means first it called __init__ of B then A. if you cut "super().__init__()" from B and paste it in A and you inherit "class C(A, B):" like this then the output is:- init c init A init B
I have a doubt. What if we create one function in Class A and one function in Class B but with the same name. now i inherit Class A in Class B and after creating an object for class B and want want to call that function but from class A. For Example---- class A: def F1(self): print("I am Function 1 from Class A") class B(A): def F1(self): print("I am Function 1 from Class B") b = B() b.F1() Output will be "I am Function 1 from Class B". but i want to call function F1 from Class A.
Hello Navin sir, as mentioned 'C' class is inherited with class 'A' & 'B' then how to call class 'B's feature1() method from class 'C' object. By default, it is calling class 'A's feature1() method & found no option to call class 'B' feature1() method. I know, there will be way to call this method, could you please let me know how to do that. Thanks !!
Referring to the example in the video, in case of multiple inheritance, What if I want to call both the left(A) and right(B) super classes constructor in the sub-class(C)'s constructor? How will I achieve it ? If you could help me out. Thank you in advance. :)
Sir I tried one crazy thing. I defined two same methods and called them with object. Why it is printing the second method? Can u clarify my doubt sir,Please. class A: def __init__(self): print('This is A init') def feature1(self): print('this is feature 1') def feature1(self): print('this is feature 2') a1=A() a1.feature1() The result of above code is "this is feature 2". How it is calling?
OMG, This course is far better than other paid course. I may sound like an agent of Telusko or Naveen, but the course is designed specifically as per the need of the users. Most of the time we come across the videos where the contents are limited by the knowledge of the presenter or speaker and even the speaking ability of the teacher determines the quality of a course. But this playlist on python is amazing. Complete package. Naveen not only having the enormous amount of knowledge but also his speaking and verbal ability is of sky high level. Thanks a lot. Ahhhh, Forgot 1 thiing, The way the deliver the final word "BYE" in the Shahrukh style. Its cherry on the cake.
True af 💯
@Dayal Ghoshhave you bought pytohn course
I was actually worst at coding. But after reaching till this point of this playlist I've already surpassed many of my classmates. After telling them I have learned this for free, they were shocked and even they have started learning from your course. Thank you
sir, your way of teaching is really too good. its interactive and interesting, i never get bored in between . thanks for such good content. :)
Your energy in voice never let's me zone out of the session, you're amazing! thanks
This is excellent. Focuses on subject only and explains it in the easiest way possible without throwing any unnecessary garbage in. Thanks you Sir!
You made my lockdown productive thankyou
One of the amazing courses wich I have ever seen !
This is the best best online course I have found till date. Best teacher Everrrrrrr
You had made most of the concepts super duper easy to learn. Really Thank you . Videos are really helpful. I love your way of teaching. God bless you.
Thank you for free course
I’m continuing watching your course series
It’s very helpful
I have decide
I’ll never purchase online course
As long as teacher like you are teaching for free
Thank you sir 🙏🙏🙏
english is my 3rd language so it's a bit harder for me to understand, but this guy explains it so good that im not having a hard time trying to understand what he says. what im trying to say is that i like this chanel and its better than payed courses.
Navin man you are the best in the game no doubt... Thank you man
Sir Thank you so much for all your efforts, it's the first time that I find a great techaer like you, thank you a lot
Sir your teaching is just awesome
This concept became clear very easily
I have changed my google search on python to like multithreading in python telusko ... Ha ha I now add telusko in every python topic search ... Great lectures
Twinkle twinkle little star 🌟 Navin sir python star 🌟
Boht Hard
(Siddesh) : Thanks Navin. Very infomative and rightly aligned flow.
Crystal Clear Explanation Sir !!
Thanks
Created account just to comment. Simple and to the point explanation.
Enjoying this series very much 😊😊😊
The best teacher I ever seen
Thank you for this. I am back here after so many days just to say thanks... So I had learnt python from this playlist in lockdown, and I am so grateful that I did it. I must say this has helped a lot. Lots of thanks for such videos ☺
Thank you very much , I am not able to understand this concept properly you help me made it. But I will also prefer to read python documentation to understand concept more properly after videos😊👌
Best explanation ever spotted on python object oriented programming. 🙌 great job!! Keep posting
I had already watched other python tutorial but this guy he nails the knowlede in your brain also he teaches deep concepts
Lol , so this is what u do when u ain't beating ur enemies
@@rajns8643 what
Thank u man i'm enjoying it. This tutorial is far better than other paid course👍waiting more videos of python
Keep up the good work Navin. God bless you.
Am just loving your channel ❤️
Great video. I have a question though... when you say MRO is left to right, is this because the call to Class(A,B) reads A first (as it is on left)... if we swap them around to Class(B,A) will it pick B first? Or is there some other abstract thing at play here... order of top to bottom? What if we swapped Class A and Class B around, so Class B was at the top?
Sir thanks a lot because you have provided a very useful and free of cost course which helped us to get our goals. Even this course is better than other paid courses. You helped us to save our future, You are a "Super Hero" sir. May God Bless You.
If Possible, Please conduct live session on python programming in this weekend Naveen sir.
It will very helpful to revise what we're learn.
Really, enjoy the session, clearly understand inheritance concepts -> single-level, multi-level & Multiple Inheritance
super() method usage, __init__ constructor and Method Resolution Order in inheritance.
Best python teacher ever in my life.
anyone want to do python crash course with-in 1 month, it is very helpful.
I have storage testing background, this course very helpfully for my career. All of my colleagues are fan of you sir.
wow. course is awesome.... (LOVE FROM NEPAL)
You are so good thanks for making python simpler : )
Excellent way of teaching. Thank you!
loved the music in the beginning.....i think you should make the video with the music slightly playing in low volume in the background...will make it more interesting....one thing is that it might distract people from paying attention on what you are speaking....but i've seen videos in which they narrate with music in the background and it works.
Navin, u r just amazing. Am really motivated to learn n teach like you. 👍😊
Another great video. May I suggest a new idea for future videos? A series of videos (or a longer one) building something small (maybe using TkInter, plotly, etc)
Excellent explanation. Due to MRO, this is printing init of Class A, how to print init of class B without changing (A, B) to (B, A) in Class C and do not want to print class A init. (pls note that, adding super in each class, print init in for all classes, I am looking to print for Class B only)
Thanks sir you are a very great teacher
Sir this is the best explanation for inheritence
It's very nice vedio.
you are are saying that in multiple inheritance it follows the left to right order.In c(A,B) if we want to call any method from c in b then how to call.
Awesome way of teaching
How to call class B __init__ from C class object if C is multiple inheritance i.e C(A,B): ??
Almost perfect. One question is left over: How can use access methods of B from class C(A, B) !!! I really insist on that question, because it will ruin all the reasoning behind the multiple inheritance...
Sir, Is there any way to involve constructor of class b in class c when class is involved in multiple inheritance of parent class a,b???
instead of defining class C(A,B) you call as class C(B,A) to get the init of class B
Awesome, it was very interesting to understand and gain
Hi Navin,
I couldn't understand , even if we don't specify the constructor in B it will call default constructor of B if we define object B.
But then ,why Object of B calls constructor of A if don't specify the constructor of B.
Please reply.
Navin,Thankyou so much for doing great job of providing very clear explanation of each topics in python tutorials.Eagerly waiting for Django contents.
this video is full of concepts love it
Two very very important question from this video...please answer this...I think it may be the question for majority of us
1) why the object of bast class is not created by default or constructor is not called by default as in c++ or Java does??
2) how to call constructor of all the base class in case of multiple inheritance?
What if we want to access both left and right methods from class C itself ?
Sir, what if in MRO we want class B init in calling class C???
Sir, thanks for the lecture.
But can u prepare lecture notes.
We are ready to pay for that also.
Plzz
if u make of ur own u will understand more deeply
In the case of duplicate methods between parent classes, using super() will not take any arguments to choose which to use, and will always go from left to right as you list them when defining the child class.
ie. C(A, B) will pull from A in the case of duplicates, and C(B, A) will pull from B in the case of duplicates.
In the case of duplicate methods between parent classes, you can choose which of the parent classes to use a method from by explicitly calling the method within the child class. Instead of using super().method() you can decide which instance of the duplicate to use by naming it explicitly. If your class inherits A before B, like in C(A, B), but you want to use a method from B that also exists in A, use B.method() to use it.
super(). looks like a good shortcut for when you know you will not be dealing with choosing between duplicates, and you don't want to explicitly mention which class to call from.
Lots of respect ,#Navin sir ...
Sir,I am studying in first year engineering and i have learned 70% python and also did your lectures and i have to do project of iot which require kivy library to make app and i should learn it and i also want to prepare for college placement which requires c or jawa
So,how can i plan for programming for 4 years of engineering? And should i start with c or not?
learning python without c ....is ok.. you can ....but c is the basics of every language ..it gives you primary idea about coding so learn c first then try to learn C++ because you will cover max oops concepts there then go on to java .....after that pick up one language either c++ java or python and do practicng coding on codechef...so you will increase your coding skills day by day...
Hi Navin,
Regarding what you explained at 8:04
Hi Navin, I have a question. Imagine I have two classes, A and B. In class A, I have class variable and class method. Now I want to access class variable and method from class A inside one of the the instance methods of class B. To access class method, I found that (after inheritance), I can access via using self. or A. or super().
Is there any advised way to choose among those three options?
Brother Navin I think your this video is INCOMPLETE, Bcos in Multiple Inheritance how to get Class B __Init__ you did not show
Can u tell me how to fetch the values from right super class
when class C(A,B) it will always fetch the values of A ie left to right even though you call super().__init__() multiple times.
for accessing the values of B you should write C(B,A) then it will fetch the values of B. Thats the rule of MRO...
@@faran_siddiqui-d3t what if i want to get both ?
You can write B().___init___
@@sam-ho4yf Same situation..
As you told if we have multiple inheritance,it starts from left then,what if we want to access right method?
Great one, it also covers some disputed concepts of system verilog too....😄😄
Hello Navin instead of super().__init__() , we can you A(). any difference??
you can access class B constructor...in this code
super(A, self).__init__()
NB:-i don't know the working methodology of this code. But this code is working ..
it is not working if i do super().__init__() and super(B,self).__init().
class GrandparentClass:
def __init__(self):
print ("init of GrandparentClass")
def Feature1(self):
print (" Feature 1")
class ParentClass:
def __init__(self):
print ("init of ParentClass")
def Feature1(self):
print (" Feature 2")
class SubClass(GrandparentClass,ParentClass):
def __init__(self):
super().__init__()
print ("init of SubClass")
def Feature1(self):
print (" Feature 3")
sub=SubClass()
This Code Works fine for any Python 3 Editor. Avoid using Python2
Please make a separate video on "MRO" of python
Thank you for your spoon feeding sir
thanks a lot sir !!!! This is Superb and amazing
very well explained. thank you !
U are amazing sir thank you for this
If class C inherits both A and B ,
Can I call both constructors simultaneously by some other means?
Like passing Class name in super method?
Class C(A,B)--- Prints only the __init__ method from Superclass Class A, but ClassC(B,A) prints the _init_ method from both Superclasses A and B. Explain please.
Can the instance variables of superclass be inherited from superclass to subclass using an object of subclass?
sir please up a series of python for intermediates so that it can help us in college, and making projects.
What is the difference between super(B, self).__init__() and super().__init__() both are giving the same result
In multiple inheritance what if we want to call method of B without calling A ...MRO says that A will be called first
B.__init__(self) or class C(B,A)
Class A = Have the defined constructor
Class B = does not have any defined constructor
When a = B(), on the video you told it would access the Class A Constructor only and Class B does not have any defined Constructor.
My question, in Class B, by default there would be an empty constructor like below,
def __init__(self):
pass
So, it would look for B class __init__ right?
OR
is this going to B class __init__ pass the B constructor and move to A?
in MRO concept, what if we want to call init method of class B at same time. how to do it ? please can u teach us sir?
We can use sub.__init__method(): in inheritance like super.__init__method()
you are the besttttttttttt dear sir
Sir when I was doing this programme output is not coming ..It is written that " Cannot create a consistence method resolution order for base A And B" ...Help me plzzz
You must be inheriting the class A into the class B , while using the Multiple Inheritance level
like this :
class A:
def me(self):
print("Feature 1")
class B(A):
//like this : Inheriting the class A
def me(self):
print("Feature 2")
class C(A,B):
def me(self):
print("Feature 3")
c1 = C()
c1.me()
____________In order to resolve the MRO error , you can try this (below):______________
class A:
def me(self):
print("Feature 1")
class B:
def me(self):
print("Feature 2")
class C(A,B):
def me(self):
print("Feature 3")
c1 = C()
c1.me()
@@shillpichaudhary Faced the same problem of MRO consistency. Thanks for resolving the error.
simply superb
Left to right depends on how you write , is there any specific convention how we do it?
Awesome Awesome Awesome
Hello Navin, can we explain or have another video showing how to efficiently use left n right class ?
When considering MRO, does it consider the name of the class? Does it sort according to the alphabetical order to find what is the first on the left?
class A:
def __init__(self):
print("init A")
def feature_1(self):
print("i am a feature 1")
def feature_2(self):
print("i am a feature 2")
class B:
def __init__(self):
print("init B")
super().__init__()
def feature_3(self):
print("i am a feature 3")
def feature_4(self):
print("i am a feature 4")
class C(B, A):
def __init__(self):
print("init c")
super().__init__()
def feature(self):
super().feature_1()
c_obj = C()
In above code C is inherit from B and A and I have created object of class C which call __init__ method of C and super().__init__ method of C class is calling __init__ of B method(Absolutely fine as per MRO) and I have not inherit B class from A class but super().__init__ method of B class is calling __init__ method of A class. Can alnybody please explain how it is possible without inheriting the class from another class it is calling the constructor of that class.
Belwow is the output for your reference
init c
init B
init A
let me if you got the answer ?
if you write "class C(B):" only then it is not calling __init__ of A.
It means first it called __init__ of B then A.
if you cut "super().__init__()" from B and paste it in A and you inherit "class C(A, B):" like this then the output is:-
init c
init A
init B
Absolutely fantastic.
How many types are there in inheritance sir ? because just now i found Hybrid Inheritance and Hierarchical Inheritance .
Bro, ur the Best !!👍👍
I have a doubt.
What if we create one function in Class A and one function in Class B but with the same name.
now i inherit Class A in Class B and after creating an object for class B and want want to call that function but from class A.
For Example----
class A:
def F1(self):
print("I am Function 1 from Class A")
class B(A):
def F1(self):
print("I am Function 1 from Class B")
b = B()
b.F1()
Output will be "I am Function 1 from Class B".
but i want to call function F1 from Class A.
Navin, could u pls explain how to call B's constructor here or any method in class B.
Hello Navin sir, as mentioned 'C' class is inherited with class 'A' & 'B' then how to call class 'B's feature1() method from class 'C' object. By default, it is calling class 'A's feature1() method & found no option to call class 'B' feature1() method. I know, there will be way to call this method, could you please let me know how to do that. Thanks !!
Please make videos on Django
If we want call constructor of b using c's obj in multiple inheritance what is the condition we want apply?
Is we call super()._init_() again?
i buy udemy python course but after watching ur videos sir it is better than udemy.
iam become big fan sir
Navin sir ki whistle podu....👌😍
Referring to the example in the video,
in case of multiple inheritance, What if I want to call both the left(A) and right(B) super classes constructor in the sub-class(C)'s constructor?
How will I achieve it ?
If you could help me out.
Thank you in advance. :)
so bro what the ans?
Sir I tried one crazy thing. I defined two same methods and called them with object. Why it is printing the second method? Can u clarify my doubt sir,Please.
class A:
def __init__(self):
print('This is A init')
def feature1(self):
print('this is feature 1')
def feature1(self):
print('this is feature 2')
a1=A()
a1.feature1()
The result of above code is "this is feature 2". How it is calling?