python dict 合并

a = [{"id":"1","name":"test001"},{"id":"2","name":"test002"}]

b = [{"id":"1","score":"9"},{"id":"2","score":"8"}]

list(map(lambda x,y:dict(x,**y),a,b))



This entry was posted on 2018 年 03 月 20 日 and is filed under pplife. Written by: . You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.