def extract_and_apply(l, p, f):
    result = []
    for x in l:
        if p(x):
            result.append(f(x))
    return result 
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.
 
     
     
    