all_words = sorted(
set([word.strip().lower() for word in open("/home/jermaine/cs3180cl/words.txt").readlines() if len(word) == 7]))
def is_anagram(one, two):
if len(one) != len(two):
return False
result = 0
for i in one:
result ^= ord(i)
for j in two:
result ^= ord(j)
if result != 0:
return False
return True
def find_words(words):
all_letters = "".join(words)
anagrams = []
for i in all_words:
if is_anagram(all_letters, i):
anagrams = i
continue
print('%s' % ', '.join(map(str, anagrams)))
find_words("zomomin" "am")