Last active
November 4, 2015 17:08
-
-
Save arossouw/b8fa9481c4dcbe4bab1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_anagram(word, anagram): | |
return len(list(word)) == len([char for char in list(word) if char in list(anagram)]) | |
>>> s = "Orchestra" | |
>>> b = "Carthorse" | |
>>> [char for char in list(s) if char.lower() in b.lower()] | |
['O', 'r', 'c', 'h', 'e', 's', 't', 'r', 'a'] | |
>>> b = ['Carthorse'] | |
>>> [char for char in list(s) if char.lower() in "".join(b).lower()] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment