def output_about_everything ():
print("Все товары: " +'\n' + '\t' + first["id"] + ". " + first["name"])
print('\t' + second["id"] + ". " + second["name"])
print('\t' + third["id"] + ". " + third["name"])
print('\t' + fourth["id"] + ". " + fourth["name"])
print('\t' + fifth["id"] + ". " + fifth["name"])
def output_about_special_id(in):'''# ЗДЕСЬ ОШИБКА!!!'''
if in == 1:
str1 = ("Выбранный товар: " + first["name"]) + "находится в отделе \"" + first["department"] + "\", стоимость - " + first["price"]
elif in == 2:
print("Выбранный товар: " + second["name"]) + "находится в отделе \"" + second["department"] + "\", стоимость - " + second["price"]
elif in == 3:
print("Выбранный товар: " + third["name"]) + "находится в отделе \"" + third["department"] + "\", стоимость - " + third["price"]
elif in == 4:
print("Выбранный товар: " + fourth["name"]) + "находится в отделе \"" + fourth["department"] + "\", стоимость - " + fourth["price"]
elif in == 5:
print("Выбранный товар: " + fifth["name"]) + "находится в отделе \"" + fifth["department"] + "\", стоимость - " + fifth["price"]
return str1
market = []
first = {"id":"1","name":"coca-cola","department":"drinks", "price":"85.0", "shelf life up to":"22.08.2022" }
second = {"id":"2","name":"sprite","department":"drinks", "price":"80.0", "shelf life up to":"22.08.2022" }
third = {"id":"3","name":"toblerone","department":"confectionery", "price":"250.0", "shelf life up to":"22.12.2020" }
fourth = {"id":"4","name":"choco-pie","department":"confectionery", "price":"50.0", "shelf life up to":"22.10.2020" }
fifth = {"id":"5","name":"scotish whiskey","department":"alcohol", "price":"3500.0", "shelf life up to":"----" }
market.append(first); market.append(second); market.append(third); market.append(fourth); market.append(fifth)
#print(market)
#print(first)
output_about_everything()
print("Чтобы узнать информацию о товаре - введите его номер, для продолжения введите 0 \n -> ")
in = int(input())
output_about_special_id(in)