OnlinePython

Essential List Tools Exercise

Question 1 of 4

What's the difference between filter() and map()?

numbers = [1, 2, 3, 4, 5]
result1 = list(filter(lambda x: x > 3, numbers))
result2 = list(map(lambda x: x * 2, numbers))