A user asked this:
class Engine: #Parent class
def setPower(self, power):
self.power = power
class CombustionEngine(Engine): #Child class inherited from Engine
def setTankCapacity(self, tankCapacity):
self.tankCapacity = tankCapacity
def getIt(self):
self.number = 5
return self.number
class ElectricEngine(Engine): #Child class inherited from Engine
def setChargeCapacity(self, chargeCapacity):
self.chargeCapacity = chargeCapacity
def getIt(self):
self.number = 7
return self.number
class BailgaadiEngine(Engine): #Child class inherited from Engine
def setChargeCapacity(self, chargeCapacity):
self.chargeCapacity = chargeCapacity
def getIt(self):
self.number = 9
return self.number
#Child class inherited from CombustionEngine and ElectricEngine
class HybridEngine(BailgaadiEngine, CombustionEngine, ElectricEngine):
def printDetails(self):
print("Power:", self.power)
print("Tank Capacity:", self.tankCapacity)
print("Charge Capacity:", self.chargeCapacity)
car = HybridEngine()
car.setPower("2000 CC")
car.setChargeCapacity("250 W")
car.setTankCapacity("20 Litres")
car.printDetails()
print(car.getIt())