title: Python equivalent of Ruby's .select
body: <p>I have an list/array, lets call it <code>x</code>, and I want to create a new list/array, lets call this one <code>z</code>, out of elements from <code>x</code> that match a certain condition.</p>
  
  <p>In Ruby you could do that by calling the .select method on the list/array like so:</p>
  
  <pre><code>x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  z = x.select{|a| a &lt; 5}
  </code></pre>
  
  <p>After this <code>z</code> would look like this:</p>
  
  <pre><code>z = [1, 2, 3, 4]
  </code></pre>
  
  <p>Is there a function/method in Python that I could use to get the same effect?</p>
  
  <p>If not, what is the cleanest way I could do this?</p>