map的使用(自增)ret = map(lambda x : x+100 if x % 2 == 1 else x

1 #!/usr/bin/env python
2 ret = map(lambda x : x+100 if x % 2 == 1 else x - 100, [1,2,3,4,5])
3 print(ret)
4 for i in ret :
5     print(i)
原文地址:https://www.cnblogs.com/shiluoliming/p/6215662.html