title: How to remove all elements that doesn't meet requirements from list
body: <p>I have a list:</p>
  
  <pre><code>my_list = ['a', 'b', 'c', 'a', 'b', 'c', 'a']
  </code></pre>
  
  <p>I use following code to remove elements that doesn't meet requirements:</p>
  
  <pre><code>[my_list.remove(element) for element in my_list if 'a' not in element]
  </code></pre>
  
  <p>but instead of expected <code>['a', 'a', 'a']</code> got <code>['a', 'c', 'a', 'c', 'a']</code>. Seems that after removing <code>'b'</code> Python doesn't check following <code>'c'</code> elements...</p>
  
  <p>Please advise me how to resolve this issue and efficiently remove all unnecessary elements from list.</p>