我有类似于这个[[{'title': 'Line'}], [{'title': 'asd'}]]
的数据.我想为列表中的每个列表添加一个新的键和值.
我已经try 过了,但出现错误‘List’对象不是映射.有什么建议吗?
data = [[{'title': 'Line'}], [{'title': 'asd'}]]
titleID = [{'id': 373}, {'id': 374}]
combine = [{**dict_1, **dict_2}
for dict_1, dict_2 in zip(char_id, data )]
我想要的输出如下所示:
[[{'id': 373, 'title': 'Line'}], [{'id': 374, 'title': 'asd'}]]