Possible Duplicate:
How do you split a list into evenly sized chunks in Python?
I have a list more than 500 elements long.
I want to divide it into 5 lists, each of 100 elements.
mylist = [1......................700]
if len(mylist) > 100:
newlist1 = mylist[0:100]
someothelist = mylist[100:]
if len(someotherlist) > 100:
newlist2 = someotherlist[0:100]
someotherlist2 = mylist[100:]
What's the best way to implement it using iteration?