In a nutshell, with x = [1,2,3]
, when calling f(x)
, x receives 1 argument [1, 2, 3]
. When you use the star operator f(*x)
, f receives three arguments, it is equivalent to the call f(1,2,3)
.
This is why, in Python's documentation, you will often see some_function(*args, **kwargs)
. Here the double star operator does the same, but for a dictionary: with d={"some_arg":2, "some_other_arg":3}
, calling f(**d)
is the same as f(some_arg=2, some_other_arg=3)
.
Now when you use zip, effectively you want to zip [1,2,3] with [4,5,6], so you want to pass 2 args to zip, therefore you need a star operator. Without it, you're passing only a single argument.