I have list of lists and variable like this:
a = [[(1, 2), (3, 4), (5, 6)], [(7, 8), (9, 10)], (4,5), (1,2)]
outupt required
a=[(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (4,5), (1,2)]
I have tried this solution, but it unpacks everything.
[Unpack list of lists into list
I have also tried to unpack using a for loop wrt indexes. Couldn't make it work.
for j in range (4):
if len(a[j])!= 2:
a[j]=list(itertools.chain(*a[j])