Skip to content

Instantly share code, notes, and snippets.

@alexxxmf
Created October 16, 2016 10:10
Show Gist options
  • Save alexxxmf/b24a576306b0fcfdd1e5a5033ddc2fb7 to your computer and use it in GitHub Desktop.
Save alexxxmf/b24a576306b0fcfdd1e5a5033ddc2fb7 to your computer and use it in GitHub Desktop.
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