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