Python Program using multiple inheritance without init


In this program, you will learn how to implement multiple inheritance without init in Python.


display1(self):

display2(self)

super().display1()

super().display2()

Example: How to implement multiple inheritance without init in Python

class First:
    def display1(self):
        print("Display 1 is called here")


class Second:
    def display2(self):
        print("Display 2 is called here")


class Third(First, Second):
    def view(self):
        super().display1()
        super().display2()


obj = Third()
obj.view()

Output:

Display 1 is called here
Display 2 is called here