[Tutor] Difference between filter and map

vanam vgvr620034 at gmail.com
Tue Jan 23 15:55:39 CET 2007


i want to know the difference between filter(function,sequence) and
map(function,sequence).I tried for a simple script with an function which
finds the square of the number,after including separately filter and map in
the script i am getting the same results for instance
def squ(x):
     return x*x
filter(squ,range(1,3))->1,4(output)
map(squ,range(1,3)->1,4(output)

-- 

                                           Vanam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070123/981cc04f/attachment.htm 


More information about the Tutor mailing list