Unpacking collections - AndrewMZ6/python_cheat_sheet GitHub Wiki

general idea of unpacking

>>> a = [1, 2, 3]
>>> b, c, d = a
>>> d
3

using *

>>> a = [1, 2, 3]
>>> b, *c = a
>>> c
[2, 3]
>>> type(c)
<class 'list'>
>>>