这里为什么要用strip()方法?列表中含有None,为什么没有报'NoneType' object has no attribute 'strip'?
print filter(lambda s:s and len(s.strip())>0,['test', None, '', 'str', ' ', 'END'])
print filter(lambda s:s and len(s.strip())>0,['test', None, '', 'str', ' ', 'END'])
2019-02-03
举报