Files
30-seconds-of-code/test/chunk/chunk.py
Rohit Tanwar 385bf72a3e readme-script
2018-02-20 22:42:11 +05:30

7 lines
167 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)))))