Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dictionary merge
#2
From 3.5 ** dictionary unpacking operators.
>>> x = {'a': 1, 'b': 2}
>>> y = {'c': 999, 'd': 200}
>>> z = {**x, **y}
>>> z
{'a': 1, 'b': 2, 'c': 999, 'd': 200}
Reply


Messages In This Thread
dictionary merge - by Skaperen - Jan-16-2020, 02:19 AM
RE: dictionary merge - by snippsat - Jan-16-2020, 04:04 AM
RE: dictionary merge - by Skaperen - Jan-16-2020, 07:11 AM
RE: dictionary merge - by buran - Jan-16-2020, 07:50 AM
RE: dictionary merge - by perfringo - Jan-16-2020, 08:05 AM
RE: dictionary merge - by Skaperen - Jan-17-2020, 01:28 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020