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