Split a list using python zip function

by , under python

I just found this trick. Say if you want to split a list with i number of elements into lists with j number of elements. It can easily be done with one liner using the python zip function. You just need to unzip the list specifying the “j”.
See python documentation on zip for more information on this.

Gist: https://gist.github.com/rajaramanathan/979dd880767fd051927d

Leave a Reply