How to unpack a list?
When extracting data from a list this way
line[0:3], line[:2], line[2:]
I receive an array and two variables after it, as should be expected:
(['a', 'b', 'c'], 'd', 'e')
I need to manipulate the list so the end result is
('a', 'b', 'c', 'd', 'e')
How? Thank you.
P.S. Yes, I know that I can write down the first element as line, line, line, but I think that's a pretty awkward solution.
from itertools import chain print tuple(chain(['a', 'b', 'c'], 'd', 'e'))
('a', 'b', 'c', 'd','e')