Skip to content

Commit 5be8722

Browse files
Quade KirbyQuade Kirby
Quade Kirby
authored and
Quade Kirby
committed
wow
1 parent 0534dc9 commit 5be8722

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

anagram.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def find_anagrams(listq,word1):
2+
newlist = []
3+
for word in listq:
4+
count = 0
5+
for letter in word:
6+
7+
if letter in word1:
8+
count += 1
9+
if count == len(word):
10+
newlist.append(word)
11+
12+
13+
return newlist
14+
15+
16+
17+
18+
print find_anagrams(["spare", "hello", "pears", "world", "reaps"], "parse")

0 commit comments

Comments
 (0)