Решение на Пет функции от Лъчезар Николов
Обратно към всички решения
Към профила на Лъчезар Николов
Резултати
- 8 точки от тестове
- 0 бонус точки
- 8 точки общо
- 12 успешни тест(а)
- 4 неуспешни тест(а)
Код
Лог от изпълнението
EEEE............
======================================================================
ERROR: test_list_of_latin_anagrams (test.TestAnagrams)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140319-21201-ggxldz/test.py", line 109, in test_list_of_latin_anagrams
set(map(frozenset, solution.anagrams(words))))
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in anagrams
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 42, in are_anagrams
lhs = ''.join(sorted(remove_punctuation(first_word.lower())))
NameError: global name 'remove_punctuation' is not defined
======================================================================
ERROR: test_with_different_cases (test.TestAnagrams)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140319-21201-ggxldz/test.py", line 125, in test_with_different_cases
set(map(frozenset, solution.anagrams(words))))
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in anagrams
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 42, in are_anagrams
lhs = ''.join(sorted(remove_punctuation(first_word.lower())))
NameError: global name 'remove_punctuation' is not defined
======================================================================
ERROR: test_with_different_symbols (test.TestAnagrams)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140319-21201-ggxldz/test.py", line 135, in test_with_different_symbols
set(map(frozenset, solution.anagrams(words))))
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in anagrams
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 42, in are_anagrams
lhs = ''.join(sorted(remove_punctuation(first_word.lower())))
NameError: global name 'remove_punctuation' is not defined
======================================================================
ERROR: test_with_list_of_cyrilic_anagrams (test.TestAnagrams)
----------------------------------------------------------------------
Traceback (most recent call last):
File "lib/language/python/runner.py", line 60, in thread
raise it.exc_info[1]
File "lib/language/python/runner.py", line 48, in run
self.result = func(*args, **kwargs)
File "/tmp/d20140319-21201-ggxldz/test.py", line 117, in test_with_list_of_cyrilic_anagrams
set(map(frozenset, solution.anagrams(words))))
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in anagrams
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 48, in <listcomp>
groups = [[a for a in words if are_anagrams(a, w)] for w in words]
File "/tmp/d20140319-21201-ggxldz/solution.py", line 42, in are_anagrams
lhs = ''.join(sorted(remove_punctuation(first_word.lower())))
NameError: global name 'remove_punctuation' is not defined
----------------------------------------------------------------------
Ran 16 tests in 0.010s
FAILED (errors=4)
История (2 версии и 1 коментар)
Лъчезар обнови решението на 19.03.2014 03:18 (преди над 10 години)
Лъчезар обнови решението на 19.03.2014 16:59 (преди над 10 години)