#coding:gbk
s1=[1,2,3,4,5]
s2=[11,12,13,14,15]
m=map(lambda x,y:x+y,s1,s2)
print "type(m) is:",type(m)
print "m=",m
s=[1,2,3,4,5]
sum=reduce((lambda x,y:x+y),s)
print "type(sum) is:",type(sum)
print "sum=",sum
运行结果:
type(m) is:
m= [12, 14, 16, 18, 20]
type(sum) is:
sum= 15
>>>
阅读(338) | 评论(0) | 转发(0) |