Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to merge two dictionaries in Python 3.5+



# How to merge two dictionaries
# in Python 3.5+:

>>> x = {'a': 1, 'b': 2}
>>> y = {'b': 3, 'c': 4}
>>> z = {**x, **y}
>>> z
{'c': 4, 'a': 1, 'b': 3}


This post first appeared on Ricky's Python Notes, please read the originial post: here

Share the post

How to merge two dictionaries in Python 3.5+

×

Subscribe to Ricky's Python Notes

Get updates delivered right to your inbox!

Thank you for your subscription

×