Answers for "how to merge two dict in python"

0

merge multile dict

dict1 = {"a":1, "b":2}
dict2 = {"x":3, "y":4}
merged = {**dict1, **dict2}
print(merged) # {'a': 1, 'b': 2, 'x': 3, 'y': 4}
Posted by: Guest on August-20-2020

Python Answers by Framework

Browse Popular Code Answers by Language