标签:重写 class sel 对象 The int 子类 self elf
class Father:
def f1(self):
print(‘hello‘)
class Son(Father):
def f1(self):
super(Son, self).f1() # super格式:(子类,对象).重写的方法
print(‘world‘)
obj = Son()
obj.f1()
标签:重写 class sel 对象 The int 子类 self elf
原文地址:https://www.cnblogs.com/jinbaobao/p/12044383.html