@author jackzhenguo @desc @date 2019/4/6
65 压缩列表
def filter_false(lst): return list(filter(bool, lst)) r = filter_false([None, 0, False, '', [], 'ok', [1, 2]]) print(r) # ['ok', [1, 2]]
python-small-examples/md/65.md at master · data-python/python-small-examples