返回顶部

收藏

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)

标签:Python,Buildin,Function

收藏

0人收藏

支持

0

反对

0

发表评论