Complete the hybrid inheritance case

class GrandFather:

def __init__(self):
    print("Grandfather init is called")
    self.eye_color = "blue"
    
def play_piano(self):
    print("Grandfather is playing piano")

class GrandMother:

def __init__(self):
    print("Grandmother init is called")
    self.height ="170 cm"
    
def play_guitar(self):
    print("Grandmother is playing guitar")

class Father(GrandMother,GrandFather):

def __init__(self):
    print("Father init is called")
    GrandMother.__init__(self)
    GrandFather.__init__(self)
    self.hair_color = "brown"
    
def play_sitar(self):
    print("Father is playing sitar")

class Son(Father,Mother):

def __init__(self):
    super().__init__()
    self.like_video_games = True
    
def play_counter_strike(self):
    print("Son is playing counter strike")
1 Like

class GrandFather:
def init(self):
print(“Grandfather init is called”)
self.eye_color = “blue”

def play_piano(self):
    print("Grandfather is playing piano")

class GrandMother:
def init(self):
print(“Grandmother init is called”)
self.height = “170 cm”

def play_guitar(self):
    print("Grandmother is playing guitar")

class Father(GrandMother, GrandFather):
def init(self):
print(“Father init is called”)
GrandMother.init(self)
GrandFather.init(self)
self.hair_color = “brown”

def play_sitar(self):
    print("Father is playing sitar")

class Mother:
def init(self):
print(“Mother init is called”)
self.skin_color = “fair”

def cook(self):
    print("Mother is cooking")

class Son(Father, Mother):
def init(self):
super().init()
self.like_video_games = True

def play_counter_strike(self):
    print("Son is playing counter strike")

Create an instance of Son

son_instance = Son()

Accessing attributes and methods from different classes

print(“Son’s Eye Color:”, son_instance.eye_color)
print(“Son’s Hair Color:”, son_instance.hair_color)
print(“Son’s Height:”, son_instance.height)
son_instance.play_piano()
son_instance.play_guitar()
son_instance.play_sitar()
son_instance.cook()
son_instance.play_counter_strike()

class GrandFather:
def init(self):
print(“Grandfather init is called”)
self.eye_color = “blue”

def play_piano(self):
    print("Grandfather is playing piano")

class GrandMother:
def init(self):
print(“Grandmother init is called”)
self.height =“170 cm”

def play_guitar(self):
    print("Grandmother is playing guitar")

class Father(GrandMother,GrandFather):
def init(self):
print(“Father init is called”)
GrandMother.init(self)
GrandFather.init(self)
self.hair_color = “brown”

def play_sitar(self):
    print("Father is playing sitar")

class Grandfather_in_law:
def init(self):
print(“Grandfatherinlaw init is called”)
self.skin_color = “fair”

def play_boxing(self):
    print("Grandfather in  law like playing boxing")

class Grandmother_in_law:
def init(self):
print(“Grandmotherinlaw init is called”)
self.weight = “56kg”

def play_football(self):
    print("Grandmother in  law like playing football")

class Mother(Grandfather_in_law,Grandmother_in_law):
def init(self):
print(“Father init is called”)
Grandmother_in_law.init(self)
Grandfather_in_law.init(self)
self.fav_dish = “Manchurian”

def play_basketball(self):
    print("Mother is playing basketball")

class Son(Father,Mother):
def init(self):
Father.init(self)
Mother.init(self)
self.like_video_games = True

def play_counter_strike(self):
    print("Son is playing counter strike")

class GrandFather:
def init(self):

    self.eye_color = "blue"

def play_piano(self):
    print("Grandfather is playing piano")

class GrandMother:
def init(self):

    self.height = "170 cm"

def play_guitar(self):
    print("Grandmother is playing guitar")

class Father(GrandMother, GrandFather):
def init(self):

    GrandMother.__init__(self)
    GrandFather.__init__(self)
    self.hair_color = "brown"

def play_sitar(self):
    print("Father is playing sitar")

class GrandmotherInLaw:
def init(self):

    self.height = "172 cm"

class GrandfatherInLaw:
def init(self):

    self.eye_color = "Black"

class Mother(GrandmotherInLaw,GrandfatherInLaw):
def init(self):

    GrandmotherInLaw.__init__(self)
    GrandfatherInLaw.__init__(self)
    self.skin_color = "fair"

def cook(self):
    print("Mother is cooking")

class Son(Father, Mother):
def init(self):
Father.init(self)
Mother.init(self)
self.like_video_games = True

def play_counter_strike(self):
    print("Son is playing counter strike")

son_instance = Son()
son_instance.cook()
son_instance.play_guitar()

Blockquote

class GrandFather:

def __init__(self):
    print("Grandfather init is called")
    self.eye_color = "blue"

def play_piano(self):
    print("Grandfather is playing piano")

class GrandMother:

def __init__(self):
    print("Grandmother init is called")
    self.height ="170 cm"

def play_guitar(self):
    print("Grandmother is playing guitar")

class Father(GrandMother,GrandFather):

def __init__(self):
    print("Father init is called")
    GrandMother.__init__(self)
    GrandFather.__init__(self)
    self.hair_color = "brown"

def play_sitar(self):
    print("Father is playing sitar")

class father_in_law:
def init(self):
self.type_of_person=“humble”
def play_drum(self):
print(“father_in_law plays drum”)
class mother_in_law:
def init_(self):
self.age=56
def play_trumpet(self):
print(“mother_in_law plays trumpet”)
class Mother(father_in_law,mother_in_law):
def init(self):
mother_in_law.init(self)
father_in_law.init(self)
self.style=“modern”
def play_flute(self):
print(“mother plays flute”)

class Son(Father,Mother):

def __init__(self):
    super().__init__()
    mother.__init__(self)
    self.like_video_games = True

def play_counter_strike(self):
    print("Son is playing counter strike")

ramesh=Son()
ramesh.play_drum()