I am learning python and I have as simple list as this
z = [1,2,3,4,5,6,7,8,9]
and I am just trying to unpack it, which throws me syntax error.
a,*b,c = z
>>> a,*b,c = z
File "<stdin>", line 1
a,*b,c = z
^
SyntaxError: invalid syntax
I tried changing the order of variable as well but same error. Any suggestion pls.
*bis not a valid name for a variable*b? Were you trying to separate the first and last element from the middle of the list?