Logo
Explore Help
Register Sign In
exercism/python
1
0
Fork 0
You've already forked python
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
381ec6ede9bacd4a61b2edcd90e805408cda3c09
python/exercises/anagram/example.py

10 lines
256 B
Python
Raw Normal View History

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
def find_anagrams(word, candidates):
anagram: Adopt functional style As discussed in #79. This also adds a test case to make sure that differently cased versions of a word aren't recognized as anagrams. E.g. "the" and "The" aren't anagrams.
2014-06-28 03:40:14 +02:00
return [candidate
for candidate in candidates
if _letters(candidate) == _letters(word)
if candidate.lower() != word.lower()]
add anagram assignment
2013-07-30 17:14:36 -05:00
anagram: Adopt functional style As discussed in #79. This also adds a test case to make sure that differently cased versions of a word aren't recognized as anagrams. E.g. "the" and "The" aren't anagrams.
2014-06-28 03:40:14 +02:00
def _letters(word):
return sorted(word.lower())
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 98ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API