I saw this solution for merging lists such as a = [1,2,3], b = [4,5,6]
using res = [*a, *b]
.
Assuming I have a list of sub-lists such as ls = [a,b]
is it possible to do something like res = [*i for i in ls]
?
That specific line is invalid since SyntaxError: iterable unpacking cannot be used in comprehension
. Can something similar be done?
If not, How can I create easily a list that contains all elements in sub-lists?
using python 3.5.3