title: How to iterate over x number of lists using zip
body: <p>I have several lists which I need to iterate over. I've got the zip function working very nicely, but to make my code more flexible I was wondering how you would use zip, but get the number of lists from a variable?</p>
  <p>For example, rather than:</p>
  <pre><code>for 1,2,3 in zip(list_1,list_2,list3):
      do something
  </code></pre>
  <p>We can do something more like:</p>
  <pre><code>i = 1   
  var = number of lists 
  zipall = zip(all_my_lists)
  
  
  for i in range(1,var) in zip(zipall):
      do something
  </code></pre>
  <p>This code isn't even close to working, I was just wanting to give an idea of the sort of thing I want to be able to do.
  Any tips would be very much appreciated. Thanks in advance.</p>
  <h2>Update</h2>
  <p>Thanks for the tips so far. It looks like using the * function might do the job for me.
  So far I'm trying the get the first half of my zip statement working:</p>
  <pre><code>args = [0,1]
  for i in range(*args) in zip(outputlist[0],outputlist[1]):
      print range(*args)
  </code></pre>
  <p>but line beginning &quot;for&quot; is giving me the following error:</p>
  <pre><code>TypeError: 'bool' object is not iterable
  </code></pre>
  <p>Any idea where I am going wrong? Thanks very much for the help so far.</p>