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 209 views
2 answers 231 views
1 answer 128 views
1 answer 136 views
5 answers 422 views
1 answer 184 views
...