a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] b = filter(lambda x: x % 2 != 0, a) for i in b: print(i)
filter方法求出列表所有奇数并构造新列
原文:https://www.cnblogs.com/sea-stream/p/11190599.html