If you want to split elements in a list into groups of n items, use pydash.chunk.
The code above shows an example of this method.
Link to pydash.
Link to the source code.