Created
October 4, 2016 20:39
-
-
Save glad1couldkek/826bbdb17ba1f3854e179269f7c2f448 to your computer and use it in GitHub Desktop.
This file contains hidden or 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(words, new_word): | |
| for word in words: | |
| first = [x for x in word] | |
| second = [x for x in new_word] | |
| if len(word) == len(new_word): | |
| for i in first: | |
| for j in second: | |
| if i != j: | |
| break | |
| else: | |
| print(word) | |
| find_anagrams(["spare", "hello", "pears", "world", "reaps"], "parse") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment