class A:
def __init__(self):
print('A_init')
def greeting(self):
print('안녕하세요. A입니다.')
class B(A):
def __init__(self):
super().__init__()
print('B_init')
def greeting(self):
print('안녕하세요. B입니다.')
class C(A):
def __init__(self):
super().__init__()
print('C_init')
def greeting(self):
print('안녕하세요. C입니다.')
class D(B, C):
def __init__(self):
super().__init__()
print('D_init')
pass
x = D()
x.greeting() # 안녕하세요. B입니다.
print(D.mro())