Created
October 16, 2016 10:10
-
-
Save alexxxmf/b24a576306b0fcfdd1e5a5033ddc2fb7 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 find_anagrams(list_of_words, word): | |
sliced_word = [] | |
sliced_word += word | |
list_of_anagrams = [] | |
for element in list_of_words: | |
sliced_element = [] | |
sliced_element += element | |
if sorted(sliced_element) == sorted(sliced_word): | |
list_of_anagrams.append(element) | |
return list_of_anagrams |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment