合并元组的词典

时间:2018-05-06 09:53:44

标签: python python-3.x

我有一个元组列表,其中每个元组都有许多字典,我想合并为一个(即在每个元组中,只有一个字典)。比如说,

payload = [
           (
            {"foo1":"value1"},
            {"bar1":"value1"}
           ),
           (
            {"foo2":"value2"},
            {"bar2":"value2"}
           )
          ]

我想要达到的目标是这样的:

payload = [
           {"foo1":"value1","bar1":"value1"},
           {"foo2":"value2","bar2","value2"}
          ]

0 个答案:

没有答案