how to use python to produce a group of anagram with a given list
Question: for example :giving a list

    
    
    ['car','bed','stop','pots','arc','tops','z','z','rac','deb'] 
    

then with the function: produce

    
    
    [['arc', 'car', 'rac'], ['bed', 'deb'], ['pots', 'stop', 'tops'], ['z', 'z']] 
    


Answer: Seems to be taken from [this
assigment](http://www.student.cs.uwaterloo.ca/~cs234/a5/prog.html), but the OP
doesn't specify the "no builtin sort constraint, so...

    
    
    >>> from collections import defaultdict
    >>> d=defaultdict(list)
    >>> words = ['car','bed','stop','pots','arc','tops','z','z','rac','deb']
    >>> for w in words:
    ...   d[''.join(sorted(w)].append(w)
    ... 
    >>> d.values()
    [['bed', 'deb'], ['car', 'arc', 'rac'], ['z', 'z'], ['stop', 'pots', 'tops']]
    

