Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- words = input()
- dc = {}
- while (words != "СТОП"):
- lst = words.split(": ")
- key = lst[0]
- strs = lst[1].split(", ")
- macros = []
- for var in strs:
- macros.append(int(var))
- dc[key] = [macros, macros[0] * 4 + macros[1] * 9 + macros[2] * 4]
- words = input()
- prods = input().split(", ")
- strings = {}
- for prod in prods:
- keyval = prod.split('-')
- key = keyval[0]
- val = int(keyval[1])
- strings[dc[key][0][1]] = "Продукт: {0}, калорийность: {1}".format(key, str(dc[key][1] * val))
- dict1 = OrderedDict(sorted(strings.items()))
- for var1, var2 in dict1:
- print(var2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement