菜农Python菜鸟学习笔记lambda学习

#! -*- coding:utf-8 -*-
#Python菜鸟lambda学习
#菜农[email protected] 2019.4.16
filter_me = [1, 2, 3, 4, 6, 7, 8, 11, 12, 14, 15, 19, 22]
result = filter(lambda x: x % 2 == 0, filter_me)
res = filter(lambda x: x & 1 > 0, filter_me)
for i in filter(lambda x: x & 1, range(10)):
    print(i)
    
print(*res)
print(*result)
print(filter_me)
print(*filter_me)

菜农Python菜鸟学习笔记lambda学习