class earphone(object):
def __init__(self):
print("这是一副有线耳机")
def threefive(self):
print("3.5mm耳机连接设备")
def link(self):
self.threefive()
class erjiAdapter(earphone):
def __init__(self, erji):
self.erji = erji
def link(self):
print("typeC口连接设备")
def LinkPhone(erji):
erji.link()
erji = earphone()
adpater = erjiAdapter(erji)
print("--------------------------")
LinkPhone(erji)
print("--------------------------")
LinkPhone(adpater)
"""
这是一副有线耳机
--------------------------
3.5mm耳机连接设备
--------------------------
typeC口连接设备
"""