Categories
Filters an array based on a condition.
Contributed by @itsbrunodev
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] list(filter(lambda x: x % 2 == 0, numbers)) # [2, 4, 6, 8, 10]