python中defaultdict標準字典的使用

#!python # encoding: utf-8 import collections def default_factory(): return 'default value' d=collections.defaultdict(default_factory,foo='bar',ok='ok') print 'd:',d print 'foo=>',d['foo'] pr
相關文章
相關標籤/搜索