map accepts 2 arguments .. first arg is the function and second arg is the sequence .. so it got below form:
map(func, seq)
Now the sequence is not restricted to “1”, it can have more than 1 sequence.. how-ever those have to be of the same length..
In that case, the function will be applied to each index in all the sequences..
for ex:
>>>> l = [1,10,100]
>>> m = [2,20,200]
>>> map(lambda x,y: x/y, l,m)
[0, 0, 0]
>>> map(lambda x,y: x%y, l,m)
[1, 10, 100]
>>> map(lambda x,y: x*y, l,m)
[2, 200, 20000]
>>>
map() is well used with the combination of lambda functions as you can see in the above example.
In short , To apply an operation to each item in a sequence/list and to collect the result, the map() will be really useful..
map call is similar to list comprehension..