Домашни > Октомврийска лютеница > Решения > Решението на Христо Исов

Резултати
3 точки от тестове
0 точки от учител

3 точки общо

6 успешни теста
2 неуспешни теста
Код

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

FF......
======================================================================
FAIL: test_georgis_ingredients (test.TestLyutenitsa.test_georgis_ingredients)
Georgi's ingredients should match the recipe.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 17, in test_georgis_ingredients
self.assertEqual(georgis_ingredients,
AssertionError: ['чушки', 'домати', 'патладжан', 'люти чу[62 chars]кия'] != ('чушки', 'домати', 'патладжан', 'люти чу[62 chars]кия')

======================================================================
FAIL: test_georgis_ingredients_type (test.TestLyutenitsa.test_georgis_ingredients_type)
Georgi's ingredients should be in a tuple.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/test.py", line 27, in test_georgis_ingredients_type
self.assertIsInstance(georgis_ingredients, tuple)
AssertionError: ['чушки', 'домати', 'патладжан', 'люти чушки', 'олио', 'захар', 'чубрица', 'черен пипер', 'врачанска ракия'] is not an instance of <class 'tuple'>

----------------------------------------------------------------------
Ran 8 tests in 0.001s

FAILED (failures=2)

Дискусия
История
Това решение има само една версия.