class Phone:
IMEI = None # 序列号
producer = "ITCAST" # 厂商
def call_by_4g(self): print("4g通话")
class Phone2022(Phone):
face_id = "10001" # 面部识别ID
def call_by_5g(self): print("2022年新功能:5g通话")
class NFCReader:
nfc_type = "第五代"
producer = "HM"
def read_card(self): print("NFC读卡") def write_card(self): print("NFC写卡")
class RemoteControl:
rc_type = "红外遥控"
def control(self): print("红外遥控开启了")
class MyPhone(Phone2022, NFCReader, RemoteControl):
**#pass作用:我这个类继承其他的类,但是我这个类除了继承,自己就没有自己的成员变量和方法,需要用pass保证这里语法不报错,pass本身表示是空(None)的意思**
pass
myPhone1 = MyPhone()
print(myPhone1.call_by_5g())
print(myPhone1.read_card())
print(myPhone1.write_card())