title: How can I convert this Function to list comprehension in python?
body: <pre><code>def extract_and_apply(l, p, f):
      result = []
      for x in l:
          if p(x):
              result.append(f(x))
      return result 
  </code></pre>
  
  <p>I'm new to python and I have to convert this function to a list comprehension, which I can't figure out. A little help would be really appreciated.</p>