title: How to group list items into tuple?
body: <p>I have a list of numbers, how can I group every <code>n</code> numbers into a tuple?</p>
  
  <p>For example, if I have a list <code>a = range(10)</code> and I want to group every 5 items into a tuple, so:</p>
  
  <pre><code>b = [(0,1,2,3,4),(5,6,7,8,9)]
  </code></pre>
  
  <p>How can I do this? I also want to raise an error if <code>len(a)</code> is not an integer multiple of <code>n</code>.</p>