Добавил:
chrysler_a57_mltbnk
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:семестр 1 / task
.pyclass Tele:
def __chsetLG(self):
self.__mt = "IPS"
self.__cl = "Black"
self.__pr = 50000
def __chsetSN(self):
self.__mt = "VA"
self.__cl = "Silver"
self.__pr = 40000
def __chsetPH(self):
self.__mt = "OLED"
self.__cl = "White"
self.__pr = 45000
def __init__(self, st):
check_str = True
try:
str(st)
except:
check_str = False
if check_str == True:
self.mod = st
else:
print("Invalid operation")
if self.mod == "LG":
self.__chsetLG()
elif self.mod == "SN":
self.__chsetSN()
elif self.mod == "PH":
self.__chsetPH()
def tv(self):
print(f'Model of chosen TV: {self.mod}')
print(f'Matrix type of chosen TV: {self.__mt}')
print(f'Body color of chosen TV: {self.__cl}')
print(f'Price of chosen TV: {self.__pr}')
TV = Tele("LG")
TV.tv()
TV.__chsetLG()
Соседние файлы в папке семестр 1
