You can download this code by clicking the button below.
This code is now available for download.
This function takes a list and a filtering function as arguments, and returns a new list containing all elements that pass the filtering function test.
Technology Stack : List comprehension
Code Type : Filter list
Code Difficulty : Intermediate
def a_filter(input_list, filter_func):
return [item for item in input_list if filter_func(item)]