I've seen a lot of questions on here about using *
before a tuple to expand it into something else, but it doesn't seem to work for me.
>>> l1 = (1, 2, 3)
>>> l2 = (0, l1, 4)
>>> l2 (0, (1, 2, 3), 4)
>>> l2 = (0, *l1, 4)
File "<stdin>", line 1
l2 = (0, *l1, 4)
^ SyntaxError: invalid syntax
As you can see. I can't get l1 to expand into l2 with the *
operator...
Note: This is python2.7