def filter_false(lst): return list(filter(bool, lst)) r = filter_false([None, 0, False, '', [], 'ok', [1, 2]]) print(r) # ['ok', [1, 2]]