list to list of lists of n elements code example
Example: 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)]
n = 5
my_list_of_lists = [my_list[i:i + n] for i in range(0, len(my_list), n)]