Python类与继承高阶练习

'''
class Base:

def __init__(self):
self.func()
pass

def func(self):
print('in base')


class Son(Base):
def __init__(self):
super().__init__()
self.func = 200
func = 100
def func(self):
print('in son')

s = Son() # in son
print(s.func) # 200
'''
posted @ 2022-04-15 23:42  呼长喜  阅读(42)  评论(0编辑  收藏  举报