def not_empty(s): return s and s.strip() list(filter(not_empty, ['A', '', 'B', None, 'C', ' ']))
这里为什么要 return s and s.strip() 比如s=' ',是返回' '和''么? None就返回None和None?
Sign in to make a reply
红莲爆雷刃
def not_empty(s): return s and s.strip() list(filter(not_empty, ['A', '', 'B', None, 'C', ' ']))
这里为什么要 return s and s.strip() 比如s=' ',是返回' '和''么? None就返回None和None?