I\'m trying to write the Haskel function \'splitEvery\' in Python. Here is it\'s definition:
splitEvery :: Int -> [e] -> [[e]] @\'splitEvery\' n@ s
more_itertools has a chunked function:
import more_itertools as mit list(mit.chunked(range(9), 5)) # [[0, 1, 2, 3, 4], [5, 6, 7, 8]]