7 lines
173 B
Python
7 lines
173 B
Python
from math import ceil
|
|
|
|
|
|
def chunk(arr, size):
|
|
return list(
|
|
map(lambda x: arr[x * size:x * size + size],
|
|
list(range(0, ceil(len(arr) / size))))) |