класс Телефон: def init (self, brand, model_name, цена): self.brand = бренд self.model_name = model_name self.price = цена # _name #
@property
def complete_specification(self):
print(f'{phone1.brand} {phone1.model_name} is of {phone1.price}')
def make_a_call(self, phone_number):
print(f'calling {phone_number}')
def full_name(self):
return f'{brand} {model_number}'
phone1 = Phone ('Apple', 'Iphone 11 pro', 125000)
phone1.price = 500
класс Smart_phone: def init (self, бренд, имя модели, цена, оперативная память, внутренняя память, камера заднего вида): # super (). init (бренд, имя модели, цена) Телефон. init (собственная личность, бренд, имя модели, цена) self.ram = ram self.internal_memory = internal_memory self.rear_camera = Rear_camera
smart_phone1 = Smart_phone («Apple», «Iphone 11 pro», 125000, «12GB», «128GB», «12MP») ) phone2 = Smart_phone («Oneplus», «6 pro», 57000, «8 ГБ», «64 ГБ», «64MP»)
print (smart_phone1.model_name) print (phone2.fullname)