I am trying to come up with a function that takes an input x and split a big list with the number of elements x*x into x smaller lists with x elements in every list E.g:
big_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
def split_list (x):
big_list = pairs (x)
small_list = [big_list[0:x] for x in range (x)]
My output has to be:
[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]
but I'm not getting it, what do you recommend ?