Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Chunk by Wartem
from typing import Iterable
def chunking_by(items: list, size: int) -> Iterable:
return [items[i:i+size] for i in range(0, len(items), size)]
Aug. 7, 2022