title: Python - Average every "n" elements in a list
body: <p>I need to average every <code>n</code> elements in Python list, <code>n = 3</code> in this example:</p>
  
  <pre><code>list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
  </code></pre>
  
  <p>So that the output list would be: </p>
  
  <pre><code>list2 = [2, 2, 2, 5, 5, 5, 8, 8, 8]
  </code></pre>