首页 > 代码库 > filter_map

filter_map

#!/usr/bin/env python
# -*- coding:utf-8 -*-

ret = filter( lambda x: x < 3, [1, 2, 3, 4, 5])
print(ret)
for i in ret:
    print(i)

ret = map(lambda x: x+100, [1, 2, 3])
for i in ret:
    print(i)

 

filter_map