In python I want to take a list and break it into a list of lists. If I have a list that is 20 numbers long, I want to turn it into a list of two lists, each 5 numbers long.
Input
nums = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
Output
new_nums = [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]]