Files
python/exercises/anagram/example.py
Thomas Fan 47bb6b5ec3 anagram: updates tests to v1.3.0 (#1482)
* anagram: updates tests to v1.3.0

* anagram: changes function name

* anagram: Updates function name
2018-08-27 14:59:08 -04:00

10 lines
256 B
Python

def find_anagrams(word, candidates):
return [candidate
for candidate in candidates
if _letters(candidate) == _letters(word)
if candidate.lower() != word.lower()]
def _letters(word):
return sorted(word.lower())