Python Class Inheritance || Empty Child Class || Multiple Inheritance || Python
In this we are going to see a basic program of multiple inheritance to demonstrate empty child class in Python Programming Language.



class houseDim:
    height = "572ft"  # predefined attributes of a class
    size = "2800sqft"

    def display_Dim(self):
        print("This house is " + self.height + " and size is " + self.size)
        # methods for displaying height

class build:
    architect = "John Doe"
    builder = "Richards hamburgers"

    def display_officials(self):
        print("The architect is " + self.architect + " and builder is " + self.builder)
        # methods for displaying architect

class house(houseDim, build):
    pass

# Driver Code
Bungalow = house()  # object creation

print(Bungalow.height + "  " + Bungalow.size)  # accessing class attributes

Bungalow.display_Dim()  # calling method through object

Bungalow.display_officials()  # calling method through object

# Coded by SAAHIL


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post