title: Python remove elements that are greater than a threshold from a list
body: <p>I would like to remove elements that are greater than a threshold from a list.</p>
  
  <p>For example, a list with elements <code>a = [1,9,2,10,3,6]</code>.</p>
  
  <p>I would like to remove all elements that are greater than 5.</p>
  
  <p>Return should be [1,2,3].</p>
  
  <p>I tried using enumerate and pop but it doesn't work.</p>
  
  <pre><code>for i,x in enumerate(a):
      if x &gt; 5:
          a.pop(i)
  </code></pre>