首页 > 代码库 > lambda实践

lambda实践

技术分享

#!/user/bin/python
# encoding:utf-8

def map2(f, seq, *seqs):
    l = []
    new_seq = [seq]
    new_seq.extend(seqs)
    print new_seq
    args_list = zip(*new_seq)
    print args_list
    for i in args_list:
        print i
        l.append(f(*i))
    return l

l = [1,2,3,4]
ll = [11,22,33,44]
f = lambda x,y:x*y
print map2(f,l,ll)

  

 

lambda实践