字典补充

代码

my_dic = collections.defaultdict(dict)
#或者
import  collections
my_dic = defaultdict(dict)

 

 把字典的 value 设置一个默认类型。

你可能感兴趣的:(字典补充)