mylist = range(150)
nestedlist = [mylist[start:start + 20] for start in range(0, len(mylist), 20)]
This entry was posted
on Saturday, November 28th, 2009 at 10:46 am and is filed under Python.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.