title: How to skip a single loop iteration in python?
body: <p>I have the following code:</p>
  
  <pre><code>for i in list1:
      if i == 5:
          #skip the NEXT iteration (not the end of this one)
      else:
          #do something
  </code></pre>
  
  <p>How do I skip the iteration that comes after the iteration that throws the skip. For example, if <code>list1=[1, 2, 3, 4, 5, 6, 7]</code>, the loop will skip 6 and go straight to 7 because 5 triggered the skip
  I've seen <a href="https://stackoverflow.com/questions/14856028/how-to-skip-a-iteration-loop-in-while-loop">this</a> question and several others, but they all deal with skipping the <strong>current</strong> iteration, while I want to skip the <strong>next</strong> iteration. The answers to those questions suggest <code>continue</code>, which as far as I can tell will stop the remainder of the current iteration and move on to the next one, which is not what I want. How can I skip a single iteration in a loop?</p>
  
  <p><strong>Edit</strong>: Using <code>next()</code> has been suggested, but this does not work for me. When I run the following code:</p>
  
  <pre><code>a = [1, 2, 3, 4, 5, 6, 7, 8]
  ai = iter(a)
  for i in a:
      print i
      if i == 5:
          _ = next(ai)
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>1
  2
  3
  4
  5
  6 #this should not be here
  7
  8
  </code></pre>
  
  <p>Using <code>next()</code> is also the suggestion in this question: <a href="https://stackoverflow.com/questions/22295901/skip-multiple-iterations-in-loop-python">Skip multiple iterations in loop python</a></p>