title: Pythonic popping from a list to another list
body: <p>I have two lists</p>
  <pre><code>a = [1,2,3]
  b = []
  </code></pre>
  <p>I want to move an element from list a, if it meets a certain condition.</p>
  <pre><code>a = [1,3]
  b = [2]
  </code></pre>
  <p>The below code shows an example, however, I would like to do this inside of a single loop. How do I do this more efficiently?</p>
  <pre><code>a = [1,2,3]
  b = []
  pop_list = []
  for i in range(len(a)):
      if a[i] == 2:
          print(&quot;pop:&quot;, a[i])
          pop_list.append(i)
  
  for i in range(len(pop_list)):
      b.append(a.pop(pop_list[i]))
  # Reset pop_list
  pop_list=[]
  </code></pre>
  <p>Ideally, I would not generate a new list b.</p>