1 00:00:00,500 --> 00:00:02,760 Biton, multiple inheritance. 2 00:00:03,230 --> 00:00:05,440 So now what is the multiple inheritance? 3 00:00:05,450 --> 00:00:09,170 We discussed that one in the previous example in the previous video. 4 00:00:09,650 --> 00:00:15,930 So now we are going to discuss that, how this multiple inheritance can be implemented in our python 5 00:00:15,950 --> 00:00:16,300 coding. 6 00:00:17,480 --> 00:00:24,000 So, like C++, a class can be derived from far more than one based classes in Python. 7 00:00:24,380 --> 00:00:26,990 And this is called the multiple inheritance. 8 00:00:27,440 --> 00:00:33,680 And in multiple inheritance, the features of all the best classes are inherited into the direct class. 9 00:00:34,040 --> 00:00:40,500 And the syntax for multiple inheritance is similar to as we use that one in the single inheritance. 10 00:00:41,000 --> 00:00:42,680 So this is our best class. 11 00:00:42,690 --> 00:00:42,980 No. 12 00:00:42,980 --> 00:00:45,090 One having our feature, one and two. 13 00:00:45,620 --> 00:00:50,930 This is of a best class number two, having got feature three and feature four after getting inherited, 14 00:00:50,930 --> 00:00:55,580 we're having feature one feature to feature three feature for that available in the class. 15 00:00:55,940 --> 00:00:59,390 Let us suppose that it's a feature we have added to the direct class. 16 00:00:59,390 --> 00:01:00,200 That is our feature. 17 00:01:00,200 --> 00:01:00,540 Right. 18 00:01:00,980 --> 00:01:06,640 And in this way, the multiple inheritance can be can be implemented in our python coding. 19 00:01:06,920 --> 00:01:12,650 So let us go for one practical demonstration to show you that how this multiple inheritance can be can 20 00:01:12,650 --> 00:01:13,180 be coded. 21 00:01:13,550 --> 00:01:19,850 So here is the demonstration for you in case of multiple inheritance will be having multiple classes 22 00:01:19,850 --> 00:01:23,840 and one direct class at the direct class will be deriving properties. 23 00:01:24,050 --> 00:01:26,540 That is a method of vegetables from the classes. 24 00:01:26,930 --> 00:01:33,470 And here we are having one example, class based one having one statement plus class based to having 25 00:01:33,470 --> 00:01:40,400 one statement Boshier and a class multi derived which will take this this one and besta as the base 26 00:01:40,430 --> 00:01:44,850 classes are the super classes and will have only one statement possible. 27 00:01:45,230 --> 00:01:48,770 So if I can execute this one, you see, there is no way that has occurred. 28 00:01:49,010 --> 00:01:51,560 So Python supports multiple inheritance. 29 00:01:51,920 --> 00:01:53,880 So let us go for another example here. 30 00:01:54,290 --> 00:01:59,780 So here we are having class based one, which is having only one method that is a function based one. 31 00:02:00,200 --> 00:02:02,840 These are the required print statement to be executed. 32 00:02:03,390 --> 00:02:09,740 And here we are having class Besta only one function that is a function based on here. 33 00:02:09,770 --> 00:02:14,720 This thing will get executed and Bisley having only one function inside it. 34 00:02:15,020 --> 00:02:17,370 That is a function three unrestrictive. 35 00:02:17,420 --> 00:02:24,950 The print statement is mentioned not here to add having that is a mighty derived base one my best to 36 00:02:24,980 --> 00:02:25,780 come up three. 37 00:02:26,300 --> 00:02:30,860 So here we are having multiple classes and only one direct class. 38 00:02:31,010 --> 00:02:36,850 The name of the direct class is mighty derived and we are having three based classes, this one, two 39 00:02:36,890 --> 00:02:37,530 and three. 40 00:02:38,060 --> 00:02:44,700 So here we are having only one function that is a function derived and where this function might derive 41 00:02:44,780 --> 00:02:45,590 is executing. 42 00:02:45,830 --> 00:02:48,490 The string will get printed by the method. 43 00:02:48,920 --> 00:02:50,820 So now let us go for it. 44 00:02:50,940 --> 00:02:51,440 Go for. 45 00:02:52,550 --> 00:02:59,930 Our object declaration on this might tonight, so maybe one is the object name, so it might be derived, 46 00:03:00,710 --> 00:03:08,440 object might derived, we have all this might be constructed on this object has got defined and instantiated. 47 00:03:08,870 --> 00:03:11,290 Now, maybe one dot function, best one. 48 00:03:11,300 --> 00:03:16,940 So that means this particular function is getting called and then function best to this function is 49 00:03:16,940 --> 00:03:18,350 being called function. 50 00:03:18,350 --> 00:03:23,300 Basically this function has been called as they are the best classes to the Z class. 51 00:03:23,420 --> 00:03:30,170 So their respective functions that is up member functions get integrated into this might be derived 52 00:03:30,440 --> 00:03:31,580 as a result of that. 53 00:03:31,820 --> 00:03:32,910 This might be right. 54 00:03:32,930 --> 00:03:35,750 Class object from this might be the class object. 55 00:03:36,020 --> 00:03:40,550 If I want to access those functions, I shall be allowed to access that one. 56 00:03:40,700 --> 00:03:46,940 And also I can access that function, which is defined itself within this might be derived class. 57 00:03:47,300 --> 00:03:49,130 So now let us go for the execution. 58 00:03:50,610 --> 00:03:52,260 You can find that function. 59 00:03:52,290 --> 00:03:59,160 This one is executing this function has got a successful execution function, besta is executing, function, 60 00:03:59,160 --> 00:04:03,330 bisley's, executing and function multi-device is executing. 61 00:04:03,540 --> 00:04:10,170 That means that all the functions they have executed and respective print statements are printing their 62 00:04:10,170 --> 00:04:12,910 respective strings to be printed. 63 00:04:13,320 --> 00:04:20,220 So in this way, in this example, we have demonstrated how to define one one class where it will be 64 00:04:20,220 --> 00:04:25,650 having multiple based classes on how to implement multiple inheritance in Biton. 65 00:04:26,190 --> 00:04:27,420 Thanks for watching this video.