1 00:00:07,050 --> 00:00:08,760 Hi everyone. 2 00:00:08,760 --> 00:00:09,570 Welcome back. 3 00:00:09,570 --> 00:00:17,220 In this lecture we will talk about multiple inheritance multiple little inheritance like single or one 4 00:00:17,220 --> 00:00:18,630 time inheritance. 5 00:00:18,630 --> 00:00:25,320 But we will make our class inherit from more than one class. 6 00:00:25,350 --> 00:00:36,390 For example if we have a class called fruit which contain Jeff and it may sound self and season and 7 00:00:37,090 --> 00:00:47,510 color set for that season equals season sell for that color equal color and the class fruit name def 8 00:00:48,330 --> 00:00:48,900 and it 9 00:00:51,690 --> 00:00:54,900 self and the name self for the name equal. 10 00:00:54,910 --> 00:01:07,940 Name and we have another class called citrus fruit which will inherit the arguments and instances from 11 00:01:08,920 --> 00:01:15,230 the first and second classes which called fruit and the fruit name. 12 00:01:15,230 --> 00:01:28,910 Jeff and it self and season and the color and the name which are the instances of our last classes SubA. 13 00:01:29,330 --> 00:01:41,630 We will use solvers as we used an early lecture of our course about Single inheritance or one time in 14 00:01:41,690 --> 00:01:47,120 inheritance or a class inherit from another one class only solver. 15 00:01:47,330 --> 00:01:55,730 Double underscore and it double underscore self and season on the color super dot underscore a double 16 00:01:55,730 --> 00:02:03,730 underscore in it on the double underscore self and the name and we will add the rubber. 17 00:02:04,210 --> 00:02:14,740 Method will which will take a self and instance to print out our any senses return. 18 00:02:14,770 --> 00:02:22,250 F citrus fruit self disease on self-esteem and self colors. 19 00:02:22,570 --> 00:02:27,080 This is try to run our code. 20 00:02:27,560 --> 00:02:34,390 Then we will create an object called fruit one equals citrus fruit. 21 00:02:34,400 --> 00:02:41,020 Winter for season lemon for name yellow for colors. 22 00:02:41,870 --> 00:02:43,360 We will get type error. 23 00:02:43,580 --> 00:02:44,150 Why. 24 00:02:44,180 --> 00:02:49,490 Because in Single inheritance or one time inheritance we use super. 25 00:02:50,030 --> 00:02:58,640 But we can use super in multiple inherit which we will make our class citrus fruit will inherit instances 26 00:02:58,730 --> 00:03:08,620 and the album is from glass root and the glass fruit name so we will use the class's names as follows. 27 00:03:08,620 --> 00:03:11,910 Class citrus fruits fruit and fruit name. 28 00:03:12,010 --> 00:03:19,710 Yes double underscore and it double underscore safe and seasoned and the colour and the name fruit that 29 00:03:20,310 --> 00:03:27,090 under double underscore and it double underscore surf season the color fruit double underscore in it 30 00:03:28,000 --> 00:03:30,850 double underscore self and the name. 31 00:03:31,200 --> 00:03:37,340 Then we will add our rubber class to bring out our instances. 32 00:03:37,380 --> 00:03:40,100 This is always is good. 33 00:03:40,320 --> 00:03:47,610 Then we will create our object as we created last time. 34 00:03:47,820 --> 00:03:52,230 Then we will call that it's our roots. 35 00:03:52,260 --> 00:04:02,910 We will get that sense as soon as the mean of our class or the name of our class and when we run our 36 00:04:02,910 --> 00:04:06,420 object fruit one we will get citrus fruit. 37 00:04:06,570 --> 00:04:11,180 Winter yellow and lemon. 38 00:04:11,400 --> 00:04:13,600 Hope you enjoy this lecture. 39 00:04:13,600 --> 00:04:15,880 Thank you for watching. 40 00:04:15,880 --> 00:04:17,770 See you next lecture. 41 00:04:17,770 --> 00:04:18,340 Bye bye.