使用Python3.8 于2019/10/20开始录制
继承
super()
#这里Person就是父类 class Teacher(Person): def __init__(self, name, age): super().__init__(name,age)
#上一行调用父类里的初始化方法,也叫构造方法
t1 = Teacher('sk',50) t1.eat()