How to merge three dictionaries in Python

1 Answer

0 votes
dic1 = {'python':34, 'php':1000, 'java':12, 'c':19, 'c++':18}
   
dic2 = {'c#':765, 'php':99, 'java':8371} 

dic3 = {'c#':19, 'vb':32, 'java':1}

dic4 = {**dic1 , **dic2, **dic3}
 
print(dic4)
   
   
   
'''
run:
   
{'python': 34, 'php': 99, 'java': 1, 'c': 19, 'c++': 18, 'c#': 19, 'vb': 32}
   
'''

 



answered Jan 30, 2020 by avibootz

Related questions

4 answers 243 views
3 answers 244 views
244 views asked Feb 19, 2019 by avibootz
1 answer 168 views
168 views asked Dec 15, 2022 by avibootz
2 answers 179 views
179 views asked Dec 15, 2022 by avibootz
...