Mar-22-2019, 05:40 PM
(Mar-20-2019, 04:09 PM)ichabod801 Wrote: Instead of taking the items off individually, you could take them off in slices:
L1 = [[1,2,3],[4,2],[6,8,1],[4,3]] L2 = [1,2,3,4,5,6,7,8,9,10] L3 =[] start = 0 for sub in L1: L3.append(L2[start:(start + len(sub))]) start += len(sub)
Thanks a lot! I had that idea, but couldn't figure out how to do that in Python.