将两个词典列表合并为一个词典列表

时间:2020-05-02 22:18:20

标签: python

我有两个字典列表,我不在乎输出是否有重复值。

first = [{"1": "a"}, {"2": "b"}] 
second = [{"3": "c"}, {"4": "d"}] 

我想创建一个看起来像这样的列表:

third = [{"1": "a"}, {"2": "b"}, {"3": "c"}, {"4": "d"}] 

我试图这样做

third = first.append(second)

但是,这给了我

third = [[{"1": "a"}, {"2": "b"}], [{"3": "c"}, {"4": "d"}]] 

0 个答案:

没有答案