Biton, multiple inheritance.
So now what is the multiple inheritance?
We discussed that one in the previous example in the previous video.
So now we are going to discuss that, how this multiple inheritance can be implemented in our python
coding.
So, like C++, a class can be derived from far more than one based classes in Python.
And this is called the multiple inheritance.
And in multiple inheritance, the features of all the best classes are inherited into the direct class.
And the syntax for multiple inheritance is similar to as we use that one in the single inheritance.
So this is our best class.
No.
One having our feature, one and two.
This is of a best class number two, having got feature three and feature four after getting inherited,
we're having feature one feature to feature three feature for that available in the class.
Let us suppose that it's a feature we have added to the direct class.
That is our feature.
Right.
And in this way, the multiple inheritance can be can be implemented in our python coding.
So let us go for one practical demonstration to show you that how this multiple inheritance can be can
be coded.
So here is the demonstration for you in case of multiple inheritance will be having multiple classes
and one direct class at the direct class will be deriving properties.
That is a method of vegetables from the classes.
And here we are having one example, class based one having one statement plus class based to having
one statement Boshier and a class multi derived which will take this this one and besta as the base
classes are the super classes and will have only one statement possible.
So if I can execute this one, you see, there is no way that has occurred.
So Python supports multiple inheritance.
So let us go for another example here.
So here we are having class based one, which is having only one method that is a function based one.
These are the required print statement to be executed.
And here we are having class Besta only one function that is a function based on here.
This thing will get executed and Bisley having only one function inside it.
That is a function three unrestrictive.
The print statement is mentioned not here to add having that is a mighty derived base one my best to
come up three.
So here we are having multiple classes and only one direct class.
The name of the direct class is mighty derived and we are having three based classes, this one, two
and three.
So here we are having only one function that is a function derived and where this function might derive
is executing.
The string will get printed by the method.
So now let us go for it.
Go for.
Our object declaration on this might tonight, so maybe one is the object name, so it might be derived,
object might derived, we have all this might be constructed on this object has got defined and instantiated.
Now, maybe one dot function, best one.
So that means this particular function is getting called and then function best to this function is
being called function.
Basically this function has been called as they are the best classes to the Z class.
So their respective functions that is up member functions get integrated into this might be derived
as a result of that.
This might be right.
Class object from this might be the class object.
If I want to access those functions, I shall be allowed to access that one.
And also I can access that function, which is defined itself within this might be derived class.
So now let us go for the execution.
You can find that function.
This one is executing this function has got a successful execution function, besta is executing, function,
bisley's, executing and function multi-device is executing.
That means that all the functions they have executed and respective print statements are printing their
respective strings to be printed.
So in this way, in this example, we have demonstrated how to define one one class where it will be
having multiple based classes on how to implement multiple inheritance in Biton.
Thanks for watching this video.