title: How to delete current element read in list by Python?
body: <p>Here is what I exactly want:</p>
  
  <pre><code>A = [1,2,3]
  
  for a in A:
      if a &gt; 1:
          del a
  
  print(A)
  </code></pre>
  
  <p>I want list a to be [1], however it will still be [1,2,3].</p>
  
  <p>So my real goal is to delete current element I get now.</p>
  
  <p>I know there is one usage of 'del' liking this:</p>
  
  <pre><code>A = [1,2,3]
  
  for i, a in enumerate(A):
      if a &gt; 1:
          del A[i]
  
  print(A)
  </code></pre>
  
  <p>and list a will be [1,3] but not [1].</p>
  
  <p>Because when I use</p>
  
  <pre><code>del a[1] #2
  </code></pre>
  
  <p>the orginally 3 in list A will be needed to use index 1 to get it from list A rather than using 2. So I can not delete it successfully.</p>
  
  <p>How can I delete the current element in the list?</p>