Return to Snippet

Revision: 21840
at December 22, 2009 14:59 by magicrebirth


Initial Code
mylist = range(150)

nestedlist = [mylist[start:start + 20] for start in range(0, len(mylist), 20)]

Initial URL

                                

Initial Description

                                

Initial Title
Break a list into n sublists

Initial Tags
list, python

Initial Language
Python