How to add dictionary and new key value elements to new dictionary in Python

1 Answer

0 votes
language1 = {'python': 13, 'php': 50, 'java': 6}

new_dic = {**language1, 'c++': 2, 'c#': 99}

print(new_dic)
 
 
'''
run:
 
{'java': 6, 'c#': 99, 'c++': 2, 'python': 13, 'php': 50}
  
'''

 



answered Aug 29, 2018 by avibootz

Related questions

2 answers 163 views
2 answers 188 views
1 answer 108 views
5 answers 337 views
1 answer 115 views
1 answer 134 views
...