Anagrams – Python

Friday, June 4th, 2010

Write a Python function to find all the anagrams for each of a supplied list of words. For the word dictionary to find the anagrams you could use the one found on Unix or OS X boxes at /usr/share/dict/words. So for example: >>> for group in anagrams(['dog','cat','horse']): ... ...