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