Multilevel Inheritamce

 


#! Multilevel inheritence

class Grandfather:
    
    def __init__(self):
        print("GRAND Father class constractor")
    
    def showg(self):
        print("grand father class instance mathod")


class Father(Grandfather):
    
    def __init__(self):
        super().__init__()
        print("Father class constractor")
    
    def showf(self):
        print("father class instance mathod")


class Son(Father):
    
    def __init__(self):
        super().__init__()
        print("son class constractor")
    
    def shows(self):
        print("Son  class instance mathod")


munna=Son()


#NB: Instance ba jekono kichu call korte super er dorkar nai
#super sudhu lage e instance veriable er khatre
munna.showg()

Comments

Popular posts from this blog

D WEB LINK