Решение на Пет малки функции от Ирина Христова
Резултати
- 10 точки от тестове
- 0 бонус точки
- 10 точки общо
- 19 успешни тест(а)
- 0 неуспешни тест(а)
Код
def extract_type(items, type_):
return ''.join(map(
lambda x: str(x[0]) * x[1],
filter(lambda y: type(y[0]) is type_, items)))
def reversed_dict(items):
return dict(zip(items.values(), items.keys()))
def reps(items):
return tuple(filter(lambda x: items.count(x) >= 2, items))