python 字典的合并

 

d1 = {'a': 100, 'b': 200}  
d2 = {'x': 300, 'y': 200}  
d = d1.copy()  
d.update(d2)  
print(d)

 

posted @ 2018-11-20 19:53  anobscureretreat  阅读(269)  评论(0编辑  收藏  举报