摘要:
假设我们要实现以下4种动物: Dog - 狗狗; Bat - 蝙蝠; Parrot - 鹦鹉; Ostrich - 鸵鸟。 按类型可以分类:哺乳动物,鸟类 按功能可以分类: 会飞的,会跑的 使用类的多重继承: class Animal(object): pass # 大类: class Mammal(Animal): pass class Bird(Animal): ... 阅读全文
posted @ 2016-07-31 00:41
黄小墨
阅读(495)
评论(0)
推荐(0)