my_tuple=(0,1,2,3,4,5,6) foo=list(filter(lambda x: x-0 and x-1, my_tuple)) print(foo) output:[2, 3, 4, 5, 6] 谁能解释一下output
x-0 and x-1这里要求x-0和x-1结果不能为0,所以过滤掉了0,1