Perbedaan Python antara filter dan peta
nums = [1, 2, 3, 4, 5]
list(map(lambda x: x**2, nums))
#1 4 9 16 25
list(filter(lambda x: x%2==0, nums))
#2 4 6 8
CodeHunter
nums = [1, 2, 3, 4, 5]
list(map(lambda x: x**2, nums))
#1 4 9 16 25
list(filter(lambda x: x%2==0, nums))
#2 4 6 8