Python is one of the world's most popular programming languages. You can use Python for Data Science, Machine Learning, Web Development, Desktop Application. Python is very easy to learn and use. So, here are 5 cool python tricks to make everyday wor...
parth104.hashnode.dev4 min read
Merging two dicts is much easier in Python 3.9 with the | operator.
x = {'p': 1, 'q': 2}
y = {'q': 3, 'r': 4}
z = x | y
If you wanted to simply append the k, v pairs of y to the end of x, you can use the shortcut.
x |= y
Nevertheless, I would never have thought of your method. Great job!
Parth Panchal
Software engineer
Great content π