TA的每日心情 | 奋斗 2023-2-7 23:45 |
---|
签到天数: 9 天 [LV.3]偶尔看看II
|
发表于 2022-2-28 17:22:30
|
显示全部楼层
class Master(object):
def __init__(self):
12 self.kongfu = '[古法煎饼果⼦配⽅]'
def make_cake(self):
print(f'运⽤{self.kongfu}制作煎饼果⼦')
class School(object):
def __init__(self):
self.kongfu = '[⿊⻢煎饼果⼦配⽅]'
def make_cake(self):
print(f'运⽤{self.kongfu}制作煎饼果⼦')
# 独创配⽅
class Prentice(School, Master):
def __init__(self):
self.kongfu = '[独创煎饼果⼦配⽅]'
def make_cake(self):
print(f'运⽤{self.kongfu}制作煎饼果⼦')
daqiu = Prentice()
print(daqiu.kongfu)
daqiu.make_cake()
print(Prentice.__mro__)
34
567
89
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 |
|