#!/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)
时间: 2024-11-07 22:29:14
#!/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)