标签:parrot run 多继承 ima blog span runnable logs python
class Animal: pass class Mammal(Animal):#哺乳类 pass class Bird(Animal):#鸟类 pass class Dog(Mammal): #狗类 pass class Parrort(Bird): #鹦鹉类 pass class Runnable: #跑类 def run(self): print(‘running...‘) class Flyable: #分类 def fly(self): print(‘flying...‘) #多继承开始了,注意高能预警 class Dog(Mammal, Runnable): pass class Parrot(Bird, Flyable): pass
标签:parrot run 多继承 ima blog span runnable logs python
原文地址:http://www.cnblogs.com/yuebei/p/7102576.html