标签:lambda lam mba filter bad markdown rem none 去掉
a = [2,4,0,8,9,10,100,0,9,7]
Filter
a= filter(None, a)
Lambada
a = filter(lambda x: x != 0, a)
for
for b in a:
if b == 0:
a.remove(b)
标签:lambda lam mba filter bad markdown rem none 去掉
原文地址:http://www.cnblogs.com/james0/p/7993444.html