Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
single line solution in Clear category for Chunk by BumKlatsch
from typing import Iterable
def chunking_by(items: list, size: int) -> Iterable:
return [list(items[n:n+size]) for n in range(0, len(items), size)]
Oct. 27, 2020
Comments: