How to add a dictionary to another dictionary in Python

1 Answer

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

dic1.update(dic2)
 
print(dic1)
   
   
   
'''
run:
   
{'python': 34, 'java': 12, 'c': 19, 'c++': 18, 'c#': 765, 'php': 99}
   
'''

 



answered Jan 30, 2020 by avibootz
...