子类继承父类
class Phone: IMEI=2020001 producer="apple" def call_by_4g(self): print("4g通话") class Phone2023(Phone): face_id="2233" def call_by_5g(self): print(f"2023最新5g视频通话") #实例化某个对象 phone1=Phone2023() print(phone1.producer) phone1.call_by_4g() phone1.call_by_5g()
'''
apple
4g通话
2023最新5g视频通话
'''