multiple inheritance in python

Publicado el: 16 mayo 2020
en el canal de: 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


En esta página del sitio puede ver el video en línea multiple inheritance in python de Duración hora minuto segunda en buena calidad , que subió el usuario Tarun Sir 16 mayo 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 55 veces y le gustó 3 a los espectadores. Disfruta viendo!