I know that the starred expression in python does this:
>>> a, *b = [1, 2, 3, 4]
>>> b
[2, 3, 4]
And this:
>>> def test(*args):
print(args)
>>> test(1, 2, 3, 4)
(1, 2, 3, 4)
So what is it doing in this line? This line is supposed to group a list into sequential n-tuples.
zip(*[lst[i::n] for i in range(n)])
What does the star do? I tried to get its value, but it gives me an error:
>>> a = *[1, 2, 3, 4]
SyntaxError: can't use starred expression here
And when I tried it with a sample list:
>>> zip(*[1, 2,3, 4])
TypeError: zip argument #1 must support iteration
What does this mean? Aren't lists iterable? I must not be understanding a key concept with the star operator (if it's an operator). Please explain. (I'm using Python 3.5.2 if that helps.)