Home / Python Tips Generated By ChatGPT / The filter() Function for Filtering Data in Python Filter items out of an iterable. Source Code numbers = [1, 2, 3, 4, 5, 6] even_numbers = list(filter(lambda x: x % 2 == 0, numbers)) print(even_numbers)