Best method for dividing list into equal parts
<blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-evenly-sized-chunks-in-python">How do you split a list into evenly sized chunks in Python?</a>  </p>
</blockquote>

<p>I have a list more than 500 elements long.</p>

<p>I want to divide it into 5 lists, each of 100 elements.</p>

<pre><code>mylist = [1......................700]
if len(mylist) &gt; 100:
       newlist1 = mylist[0:100]
       someothelist = mylist[100:]
       if len(someotherlist) &gt; 100:
           newlist2 = someotherlist[0:100]
           someotherlist2 = mylist[100:]
</code></pre>

<p>What's the best way to implement it using iteration?</p>
