4 lines
145 B
Python
4 lines
145 B
Python
|
def chunks(lst: list, n: int):
|
||
|
"""Yield successive n-sized chunks from lst."""
|
||
|
for i in range(0, len(lst), n):
|
||
|
yield lst[i:i + n]
|