use defaultdict
Merge pull request #1 from dlutcat/master

Use collections.defaultdict.