I have a big array of 10573 elements and I want to group them into chunks but skipping two elements after each chunk.
I have the code to divide the list into chunks:
chunk_size= 109 for i in range(0, len(ints), chunk_size): chunk = ints[i:i+chunk_size]
But how do I skip or delete two elements from the big list iteratively, i.e., after attaining each chunk of size 109?
Is there a way to do that?
Add 2 to the chunk size when using it in the iteration.
chunk_size= 109 for i in range(0, len(ints), chunk_size+2): chunk = ints[i:i+chunk_size]
1.4m articles
1.4m replys
5 comments
57.0k users