【发布时间】:2018-08-02 06:58:02
【问题描述】:
我有 n 个这样的字典:
dict_1 = {1: {'Name': 'xyz', 'Title': 'Engineer'}, 2: {'Name': 'abc',
'Title': 'Software'}}
dict_2 = {1: {'Education': 'abc'}, 2: {'Education': 'xyz'}}
dict_3 = {1: {'Experience': 2}, 2:{'Experience': 3}}
.
.
.
dict_n
我只想像这样根据主键组合所有这些:
final_dict = {1: {'Name': 'xyz', 'Title': 'Engineer', 'Education':
'abc', 'Experience': 2},
2: {'Name': 'abc', 'Title': 'Software', 'Education':
'xyz', 'Experience': 3}}
谁能帮我实现这个目标?
【问题讨论】:
-
我们帮助您解决代码中的错误。没有代码,没有错误需要我们解决。
-
你尝试了什么?
-
标记
python-3.x和python-2.7无助于识别您询问的Python 版本。 -
我正在寻找解决方案,我需要代码 sn-p 来实现 final_dict
标签: python python-3.x python-2.7 dictionary