标签:
示例代码:
# coding=utf-8 def add(x, y): return x + y def func(x): return x ** 2 def f(x): return x % 2 != 0 and x % 3 != 0 if __name__ == ‘__main__‘: print map(func, range(5)) print reduce(add, range(5)) print map(lambda x:x ** 2, range(5)) print reduce(lambda x, y:x + y, range(5)) print filter(f,range(2,25)) print filter(lambda x: x % 2 != 0 and x % 3 != 0,range(2,25))
标签:
原文地址:http://www.cnblogs.com/dmir/p/5026448.html