1. 程式人生 > >python-Generalization of Hops

python-Generalization of Hops

func provide arguments imp argument collect pytho bsp des

  • 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

python-Generalization of Hops