Python3 练习笔记七
# lambda ''' lambda: 定义:匿名函数关键字 作用:减少单行函数的定义,提升代码的简洁程度 ''' gf = lambda x: x + 1 print(gf(3)) print(gf(0)) foo = [2, 18, 9, 22, 17, 24, 8, 12, 27] f = filter(lambda x: x % 3 == 0, foo) for i in f: print(i) m = map(lambda x: x * 2 + 10, foo) for i in m: print(i)