超继承



class Father:

def f1(self):
print('hello')

class Son(Father):

def f1(self):
super(Son, self).f1() # super格式:(子类,对象).重写的方法
print('world')


obj = Son()
obj.f1()
posted @ 2019-12-15 15:47  菜菜_包包  阅读(124)  评论(0编辑  收藏  举报