multiple inheritance in python

Publicado em: 16 Maio 2020
no 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


Nesta página do site você pode assistir ao vídeo on-line multiple inheritance in python duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Tarun Sir 16 Maio 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 55 vezes e gostou 3 espectadores. Boa visualização!