Answers for "How do I merge two dictionaries in a single expression (taking union of dictionaries)?"

0

How do I merge two dictionaries in a single expression (taking union of dictionaries)?

z = dict(list(x.items()) + list(y.items()))

or 

z = x.copy()
z.update(y)
Posted by: Guest on July-21-2021

Code answers related to "How do I merge two dictionaries in a single expression (taking union of dictionaries)?"

Python Answers by Framework

Browse Popular Code Answers by Language