1viktors_ingredients = ["чушки", "домати", "моркови", "ябълки", "сол", "черен пипер", "кимион", "зехтин"]
2georgis_ingredients = ("чушки", "домати", "патладжан", "люти чушки", "олио", "захар", "чубрица", "черен пипер", "врачанска ракия",)
3shopping_list = (viktors_ingredients + list(georgis_ingredients))[::-1]
4unique_ingredients = set(shopping_list)
5ingredient_quantities = {}
6for ingredient in unique_ingredients:
7 ingredient_quantities[ingredient] = 5
8ingredient_quantities['skyr'] = 1
9number_of_ingredients_to_buy = len(ingredient_quantities)
10
11
........
----------------------------------------------------------------------
Ran 8 tests in 0.000s
OK
n | 1 | victors_ingredients = ["чушки", "домати", "моркови", "ябълки", "сол", "черен пипер", "кимион", "зехтин"] | n | 1 | viktors_ingredients = ["чушки", "домати", "моркови", "ябълки", "сол", "черен пипер", "кимион", "зехтин"] |
2 | georgis_ingredients = ("чушки", "домати", "патладжан", "люти чушки", "олио", "захар", "чубрица", "черен пипер", "врачанска ракия",) | 2 | georgis_ingredients = ("чушки", "домати", "патладжан", "люти чушки", "олио", "захар", "чубрица", "черен пипер", "врачанска ракия",) | ||
t | 3 | shopping_list = (victors_ingredients + list(georgis_ingredients))[::-1] | t | 3 | shopping_list = (viktors_ingredients + list(georgis_ingredients))[::-1] |
4 | unique_ingredients = set(shopping_list) | 4 | unique_ingredients = set(shopping_list) | ||
5 | ingredient_quantities = {} | 5 | ingredient_quantities = {} | ||
6 | for ingredient in unique_ingredients: | 6 | for ingredient in unique_ingredients: | ||
7 | ingredient_quantities[ingredient] = 5 | 7 | ingredient_quantities[ingredient] = 5 | ||
8 | ingredient_quantities['skyr'] = 1 | 8 | ingredient_quantities['skyr'] = 1 | ||
9 | number_of_ingredients_to_buy = len(ingredient_quantities) | 9 | number_of_ingredients_to_buy = len(ingredient_quantities) | ||
10 | 10 | ||||
11 | 11 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|