Actually I am having list of 500 elements such as
list = [1,2,3,4,5...500]
Now I want to create a batch of of 32 elements and store in nested list where the main list contains nested list of 32-32 elements and last nested list contains 20 elements such as:
final_list = [[1,2,3,..,32],[33,34,35,..,64],..,[480,481,482,..500]]
I was trying with append from loop but not having exact idea how to do so.
final_list = []
for itr in range(0,500,32):
final_list.append(l[0:itr])
Tried with various method but not able to find the correct logic. Any help would be great and thanks a lot in advance!!