title: How to group elements in python by n elements
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://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'd like to get groups of size n elements from a list l:</p>
  <p>ie:</p>
  <pre><code>[1,2,3,4,5,6,7,8,9] -&gt; [[1,2,3], [4,5,6],[7,8,9]] where n is 3
  </code></pre>