×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Matthew J_
Added: Jun 22, 2022 11:10 PM
Views: 8
Tags: no tags
  1. my_dict1 = {'a' : 1, 'b' : 2, 'c' : 3}
  2. my_dict2 = {'d' : 4, 'e' : 5, 'f' : 6}
  3.  
  4. # Method 1
  5. result = { **my_dict1, **my_dict2}
  6.  
  7. print(result)   # {‘a’: 1, ‘b’: 2, ‘c’: 3, ‘d’: 4, ‘e’: 5, ‘f’: 6}