tuple unpacking

In [3]:
title, players = ('Dixit', '3-6')

Unpack with a tuple using a * prefix.

In [4]:
two_numbers = (31, 17)
divmod(*two_numbers)
Out[4]:
(1, 14)

Use a * to collect excess items.

In [5]:
beginning, *middle, end = range(7)
In [6]:
beginning, middle, end
Out[6]:
(0, [1, 2, 3, 4, 5], 6)
In [7]:
beginning, *middle, end
Out[7]:
(0, 1, 2, 3, 4, 5, 6)

Swap the values of two variables.

In [8]:
a, b = 1, 7
a, b = b, a
a, b
Out[8]:
(7, 1)