Q:

convert list to list of lists on every n elements python

n = 5
my_list_of_lists = [my_list[i:i + n] for i in range(0, len(my_list), n)]
0

New to Communities?

Join the community