In this we are going to see a basic program on hybrid inheritance for information regarding house in Python Programming Language.
class houseDim:
height = "572ft"
size = "2800sqft"
def display_Dim(self):
print("This house is " + self.height + " and size is " + self.size)
class build:
architect = "John Doe"
builder = "Richards hamburgers"
def display_officials(self):
print("The architect is " + self.architect + " and builder is " + self.builder)
class location(houseDim, build):
hloc = "New York"
bloc = "Hamshire"
def display_loc(self):
print(f"Location of house: {self.hloc} and location of builder's office: {self.bloc}")
class house(location):
pass
Bungalow = house()
Bungalow.display_loc()
Bungalow.display_Dim()
Bungalow.display_officials()
# Coded by Saahil
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP