我有一本字典和一份清单。
我想向字典中添加一个新键,这样每个键的值都等于一个数组元素。我在下面的例子中对此做了更多解释
我的字典
[{'url': 'https://test.com/find/city-1', 'tit': 'title1', 'val': 1},
{'url': 'https://test.com/find/city-2', 'tit': 'title1', 'val': 2},
{'url': 'https://test.com/find/city-3', 'tit': 'title1', 'val': 3}
]
我的名单
['a','b','c']
我想要的是:
[{'url': 'https://test.com/find/city-1', 'tit': 'title1', 'val': 1 , 'content' ='a'},
{'url': 'https://test.com/find/city-2', 'tit': 'title1', 'val': 2, 'content' ='b'},
{'url': 'https://test.com/find/city-3', 'tit': 'title1', 'val': 3, 'content' ='c'}
]