There are similar questions but i didn't find a clean answer for what i think is simple.
I want to get once the first 1000 elements of a list, then the first 2000 ecc...
for i in range(1000, len(l1), 1000):
a = l1[:i]
but obviously won't work if len(l1) % 1000 != 0 or if len(l1) < 1000. What is an easy solution for this?
Thanks.