字典补充 代码 my_dic = collections.defaultdict(dict) #或者 import collections my_dic = defaultdict(dict) 把字典的 value 设置一个默认类型。 公众号请关注:侠之大者