I am getting an unexpected output when I execute the following python code. Iam new at python.
def foo(n):
return n+2;
print (filter(foo,[1,2]))
i was expecting output as :-
[3,4]
but Iam getting output as:-
[1,2]
please help me solve this.
map, notfilter.