title: Python: Reading n lines at a time in a list
body: <p>I'm new to python so I know there has to be a more elegant way to do this and was hoping to get some advice on this. </p>
  
  <p>Currently, I have a list that consists of x entries. I want to:</p>
  
  <ul>
  <li>Read n entries from the list at a time</li>
  <li>Do a computation with those n entries (calculating a standard deviation, so for that I need to get the mean of the n entries)</li>
  <li>Move on to the next n entries, and do another calculation with this new set of data</li>
  <li>Append all these values into a file</li>
  </ul>
  
  <p>Right now, I'm going very primitive and just doing something like:</p>
  
  <pre><code>first = mylist[0:11]
  mean = sum(first)/nentries
  second = mylist{11:22]
  mean2 = sum(second)/nentries
  ...
  </code></pre>
  
  <p>As you can see, this is extremely novice and not elegant at all if I have say 352 entries and I need to read 11 lines at a time from them. Is there an easy way to loop over the list and only pick out n entries (in this case, 11) at a time? Thanks!</p>