+ 3
What is difference between Map() and Filter () function in Python
2 odpowiedzi
+ 4
They are completely different.
map() works through each element of the list and does some transformation on each element. So in the end the result list will be the same size.
filter() has a predicate function as parameter, that means it transforms each list element to boolean True/False values, and it keeps only the truthy ones. So the size of your list can shrink, and also you will keep the original list elements without transformation.