Functional Programming Tools: map: More than one sequence may be passed : map « Buildin Function « Python






Functional Programming Tools: map: More than one sequence may be passed

Functional Programming Tools: map: More than one sequence may be passed
# the function must have as many arguments as there are sequences and is called with 
# the corresponding item from each sequence (or None if some sequence is shorter 
# than another).

seq = range(8)
def add(x, y): return x+y

print map(add, seq, seq)


           
       








Related examples in the same category

1.Do a map on list Do a map on list
2.Map: lambda function insideMap: lambda function inside
3.A sentence is split up into a list of wordsA sentence is split up into a list of words
4.Functional Programming Tools: mapFunctional Programming Tools: map
5.Use mapUse map