python 字典的合并

 

dic1={1:10, 2:20}  
dic2={3:30, 4:40}  
dic3={5:50,6:60}  
dic4 = {}  
for d in (dic1, dic2, dic3): dic4.update(d)  
print(dic4)

 

posted @ 2018-11-19 10:16  anobscureretreat  阅读(183)  评论(0编辑  收藏  举报