I was wondering whether it is possible to implement filter
function using only map
function in Python.
Suppose I have a list A = [1,2,3,4,5,6,7,8,9,10]
and I want to get only even numbers. Applying filter
function provides me a list of 5 elements but map
always returns 10 elements no matter what functions I could think.
Is there any way to achieve this?
Please don't suggest to apply filter
again on the result of map
. :-)