Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
You onl understand it if u understand it... if u understand... solution in Creative category for Chunk by new_hoschi
from typing import Iterable
def chunking_by(items: list, size: int) -> Iterable:
return [items[:size]] + chunking_by(items[size:], size) if items else []
#a,b=divmod(len(items),size)
#return [items[size*j:size*(j+1)] for j in range(a)] + [items[-b:]] if b else [items[size*j:size*(j+1)] for j in range(a)]
March 30, 2020