python-Generalization of Hops

  • python provides a general purpose HOP,map
  • simple form-a unary function and a collection of suitable arguments

代码:

for e in map(abs,[1,-2,3,-4]):
print(e)

1
2
3
4


L1=[1,28,36]
L2=[2,57,9]
for e in map(min,L1,L2):
print(e)

 

1
28
9
posted @ 2017-12-04 20:37  爱学英语的程序媛  阅读(175)  评论(0编辑  收藏  举报