01
继承
编写一个类
- class Animal(object):
- def shout(self):
- print('Animal is shouting...')
继承 Animal 的 Dog:
- class Dog(Animal):
- def shout(self):
- print('Dog is shouting...')
继承 Animal 的 Cat:
- class Cat(Animal):
- pass
来源: https://mp.weixin.qq.com/s?__biz=MzI3NTkyMjA4NA==&mid=2247485139&idx=1&sn=8a587f4facd177f57379f6dc3af63107&chksm=eb7c2b18dc0ba20e6e6ef066d5845270307507e6d7d2eda8333ffebe341bab5e24ca84101748#rd