返回顶部

收藏

Functional Programming Tools: map

更多
# 'map(function, sequence)' calls function(item) for each of the sequence's 
# items and returns a list of the return values. For example, to compute some 
# cubes:

def cube(x): return x*x*x

print map(cube, range(1, 11))

标签:Python,Function

收藏

0人收藏

支持

0

反对

0

发表评论