DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
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)
PREVIOUS
NEXT
Tagged:
#How
#I
#merge
#dictionaries
#single
#expression
#union
ADD COMMENT
Topic
COMMENT
Name
9+1 =
Submit