#-*-coding:utf-8-*-'''多重继承'''class MyFather: def __init__(self): self.eyes = '爸爸的眼睛是双眼皮' print(self.eyes)class MyMother: def __init__(self): self.forehead = '妈妈的额头有点宽' print(self.forehead)class MyAunt: def __init__(self): self.nose='姑姑的鼻子是高鼻梁' print(self.nose)class MySelf(MyFather,MyMother,MyAunt): def __init__(self,face): print('我的眼睛是双眼皮,别人说我继承的是:') MyFather.__init__(self) print('我的额头有点宽,别人说我继承的是:') MyMother.__init__(self) print('我的鼻子有点高,还有人说我继承的是:') MyAunt.__init__(self) self.face = face print('我的脸型:%s'%self.face,'这下终于没人说我像谁了')myself = MySelf('偏圆吧')
转载于:https://www.cnblogs.com/askill/p/10195938.html