multiple inheritance in python

Veröffentlicht am: 16 Mai 2020
auf dem Kanal: Tarun Sir
55
3

In this video you will learn how to implement multiple inheritance.

Multiple Inheritance
In the multiple inheritance, a single class inherits features from more than one parent class. In other words we can also say that if a class gets the features by inheritance from more than one parent classes, then it is called as hierarchical inheritance.


In this example the C class is inherited from both A and B classes. Here class C receives features from A and B, and it can also add its own features.
The following program demonstrates the multiple inheritance:

class A:
def printA(self):
print("Hello from printA() of A class")

class B:
def printB(self):
print("Hello from printB() of B class")

class C(A,B):
def printC(self):
print("Hello from printC() of C class")

obj=C()
obj.printA()
obj.printB()
obj.printC()

#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_67 #multiple_inheritance_in_python #python_tutorial


Auf dieser Seite können Sie das Online-Video multiple inheritance in python mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Tarun Sir 16 Mai 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 55 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!