Inheritance Example in Python || Fossil fuel || Multilevel Inheritance || Python
In this we are going to see a basic program on fossil fuel example with multilevel inheritance in Python Programming Language.


class Organism():
    def organism_type(self):
        print("Organism: Dinosaur")
        print("Dies 100k year back")


class Fossil(Organism):
    def fossil(self):
        print("Becomes a fossil over time")


class Fuel(Fossil):
    def fuel(self):
        print("Used as fuel for reactors")


f = Fuel()
f.organism_type()
f.fossil()
f.fuel()

# Coded By Dhiraj Shelke

#ENJOY CODING


Post a Comment

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

Previous Post Next Post