Anagram

Find anagrams of a word in a list
from collections import Counter import sys s=sys.argv[1]
 * 1) !/usr/bin/python

def anagrams(word, words): result = [] counter_word = Counter(word) for other_word in words: if Counter(other_word) == counter_word: result.append(other_word) return result

with open("words.txt") as wordfile: lines=wordfile.read.splitlines print(anagrams(s,lines))