Split list into chunks of size n. Example: [1,2,3,4,5], n=2 => [[1,2],[3,4],[5]]
Implement this function:
def chunk_list(lst: list, n: int) -> list:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: lst, n.
Input
[1, 2, 3, 4, 5]
2
Output
[[1, 2], [3, 4], [5]]