1viktors_ingredients = [
2 "чушки",
3 "домати",
4 "моркови",
5 "ябълки",
6 "сол",
7 "черен пипер",
8 "кимион",
9 "зехтин"
10]
11
12georgis_ingredients = (
13 "чушки",
14 "домати",
15 "патладжан",
16 "люти чушки",
17 "олио",
18 "захар",
19 "чубрица",
20 "черен пипер",
21 "врачанска ракия"
22)
23
24georgis_ingredients_List = list(georgis_ingredients) # Because we can't join a list and a tuple with "+"
25
26shopping_list = viktors_ingredients + georgis_ingredients_List
27
28shopping_list.reverse()
29
30unique_ingredients = set(shopping_list)
31
32ingredient_quantities = dict.fromkeys(unique_ingredients, 5)
33ingredient_quantities['skyr'] = 1
34
35number_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 | "домати", | 3 | "домати", | ||
4 | "моркови", | 4 | "моркови", | ||
5 | "ябълки", | 5 | "ябълки", | ||
6 | "сол", | 6 | "сол", | ||
7 | "черен пипер", | 7 | "черен пипер", | ||
8 | "кимион", | 8 | "кимион", | ||
9 | "зехтин" | 9 | "зехтин" | ||
10 | ] | 10 | ] | ||
11 | 11 | ||||
12 | georgis_ingredients = ( | 12 | georgis_ingredients = ( | ||
13 | "чушки", | 13 | "чушки", | ||
14 | "домати", | 14 | "домати", | ||
15 | "патладжан", | 15 | "патладжан", | ||
16 | "люти чушки", | 16 | "люти чушки", | ||
17 | "олио", | 17 | "олио", | ||
18 | "захар", | 18 | "захар", | ||
19 | "чубрица", | 19 | "чубрица", | ||
20 | "черен пипер", | 20 | "черен пипер", | ||
21 | "врачанска ракия" | 21 | "врачанска ракия" | ||
22 | ) | 22 | ) | ||
23 | 23 | ||||
24 | georgis_ingredients_List = list(georgis_ingredients) # Because we can't join a list and a tuple with "+" | 24 | georgis_ingredients_List = list(georgis_ingredients) # Because we can't join a list and a tuple with "+" | ||
25 | 25 | ||||
n | 26 | shopping_list = ( | n | 26 | shopping_list = viktors_ingredients + georgis_ingredients_List |
27 | viktors_ingredients | ||||
28 | + georgis_ingredients_List | ||||
29 | ) | ||||
30 | 27 | ||||
31 | shopping_list.reverse() | 28 | shopping_list.reverse() | ||
32 | 29 | ||||
33 | unique_ingredients = set(shopping_list) | 30 | unique_ingredients = set(shopping_list) | ||
34 | 31 | ||||
t | 35 | ingredient_quantities = dict.fromkeys(unique_ingredients,5) | t | 32 | ingredient_quantities = dict.fromkeys(unique_ingredients, 5) |
36 | ingredient_quantities['skyr'] = 1 | 33 | ingredient_quantities['skyr'] = 1 | ||
37 | 34 | ||||
38 | number_of_ingredients_to_buy = len(ingredient_quantities) | 35 | number_of_ingredients_to_buy = len(ingredient_quantities) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|