Files
30-seconds-of-code/test/chunk/chunk.py
2018-04-14 10:54:46 +00:00

7 lines
167 B
Python

from math import ceil
def chunk(lst, size):
return list(
map(lambda x: lst[x * size:x * size + size],
list(range(0, ceil(len(lst) / size)))))