Iterating over two lists one after another
<p>I have two lists <code>list1</code> and <code>list2</code> of numbers, and I want to iterate over them with the same instructions. Like this:</p>

<pre><code>for item in list1:
  print(item.amount)
  print(item.total_amount)

for item in list2:
  print(item.amount)
  print(item.total_amount)
</code></pre>

<p>But that feels redundant. I know I can write <code>for item in list1 + list2:</code>, but it has a price of running-time.</p>

<p>Is there a way do that without loose time?</p>