title: How to iterate in pairs over a list with ODD cardinality in python
body: <p>I want to iterate over a list pair-wise in Python, except the list has an odd number of elements.</p>
  <p>I know if this list is even <code>for item1,item2 in zip(alist[0::2],alist[1::2])</code> would work,
  but if the list is odd the loop breaks out before it processes the last item.</p>
  <p>Is there any efficient way to handle this?</p>
  <p><strong>Example:</strong></p>
  <pre><code>list a = (a,b,c,d,e,f,g)
  
  Expected elements in each iteration:
  
  (a,b)
  (c,d)
  (e,f)
  (g,None) # or some other placeother value for the non-existent 2nd element of the pair
  </code></pre>