I have a larger list of approximately 250 elements. I need to group every 50 elements into a sub-list and iterate through each of the sub-lists.
For example:
largerList = [0, 1, ... ..., 268]
I want the sub lists to look like:
subLists = [[0, 1, ... ..., 49], [50, 51, ... ..., 99], ... ..., [250, 251, ... ..., 268]]
Then I will be able to iterate the sub lists and do something for each of them.
for ls in subLists:
for i in ls:
DO SOMETHING...