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

Xiith is created for educational, experimental, and schooling purpose. Examples on Xiith are made easier to make a better or basic understanding. Tutorials, testimonials, and examples are continuously checked to avoid delusion, but we cannot take complete responsibility of all programs on Xiith. When you are operating this site, you have to agree to read and accept our terms of use, cookie and privacy policy.Copyright © 2020 by Xiith. All Rights Reserved. About us.