Python - ** - Dictionary Unpack Operator

Convert arbitrary method parameters to a dictionary with **kwargs

>>> def example(**kwargs):
...   print(kwargs)
...   print(kwargs['rank'])
...
>>> example(suit='Clubs', rank='Ace')
{'suit': 'Clubs', 'rank': 'Ace'}
Ace

Merge two dictionaries

>>> { 'Ace': 13, **{'King': 12, 'Queen': 11 } }
{'Ace': 13, 'King': 12, 'Queen': 11}

Get the remainder of the dictionary in match (3.10+)

>>> hand = { 'Type': 'Four of a kind', 'Cards': 'KC KH KD KS AS' }
>>> match hand:
...   case { 'Type': 'Four of a kind', **rest }:
...     print(rest)
...
{'Cards': 'KC KH KD KS AS'}