title: iterate python nested lists efficiently
body: <p>I am working on a network traffic monitor project in Python. Not that familiar with Python, so I am seeking help here. </p>
  
  <p>In short, I am checking both in and out traffic, I wrote it this way:</p>
  
  <pre><code>for iter in ('in','out'):
          netdata = myhttp()
          print data
  </code></pre>
  
  <p>netdata is a list consisting of nested lists, its format is like this: </p>
  
  <pre><code>[ [t1,f1], [t2,f2], ...]
  </code></pre>
  
  <p>Here <code>t</code> represents the moment and <code>f</code> is the flow. However I just want to keep these f at this moment for both in and out, I wonder any way to get an efficient code.</p>
  
  <p>After some search, I think I need to use create a list of traffic(2 elements), then use zip function to iterate both lists at the same time, but I have difficulty writing a correct one. Since my netdata is a very long list, efficiency is also very important. </p>
  
  <p>If there is anything confusing, let me know, I will try to clarify.
  Thanks for help</p>