Python Multilevel Inheritance

python are support multilevel inheritance.suppose your create a MusicaliInstruments class and another class StringInstruments(MusicaliInstruments) are inherit MusicaliInstruments class and an another class Guitar(StringInstruments) inherit StringInstruments class.So, this technique call multilevel inheritance

“Code below try it”

class MusicaliInstruments:

numberOfMajorKeys = 12

class StringInstruments(MusicaliInstruments):

typeOfWood = “Tonwood”

class Guitar(StringInstruments):

def __init__(self):

self.numberOfString = 6

print(“This guitar consits of {} strings. It is made {} and it can play {} kyes”.format(self.numberOfString, self.typeOfWood, self.numberOfMajorKeys))

guitar = Guitar()