Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Mommy:
- def __init__(self):
- super().__init__()
- self.eye1 = 'blue'
- self.hair_color1 = 'brown'
- self.height1 = '180'
- def eyes(self):
- print(f'Глаза:{self.eye1}')
- def hair(self):
- print(f'Цвет волос:{self.hair_color1}')
- def height(self):
- print(f'Рост:{self.height1}')
- class Daddy:
- def __init__(self):
- super().__init__()
- self.eye2 = 'gary'
- self.hair_color2 = 'red'
- self.height2 = '160'
- def eyes(self):
- print(f'Глаза:{self.eye2}')
- def hair(self):
- print(f'Цвет волос:{self.hair_color2}')
- def height(self):
- print(f'Рост:{self.height2}')
- class Child(Mommy, Daddy):
- def __init__(self):
- super().__init__()
- def coll_eyes(self):
- Mommy.eyes(self)
- def coll_height(self):
- Daddy.height(self)
- mice = Child()
- mice.coll_eyes()
- mice.coll_height()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement