The "*" operator unpacks a list and applies it to a function. The zip function takes n lists and creates n-tuple pairs from each element from both lists:
zip([iterable, ...])
This function returns a list of tuples, where the i-th tuple contains
the i-th element from each of the argument sequences or iterables. The
returned list is truncated in length to the length of the shortest
argument sequence. When there are multiple arguments which are all of
the same length, zip() is similar to map() with an initial argument of
None. With a single sequence argument, it returns a list of 1-tuples.
With no arguments, it returns an empty list.
Basically, by using *
with [[1,2,3],[4,5,6]]
, you are passing [1,2,3]
and [4,5,6]
as arguments to zip.