python 判断字符串是否为空用什么方法?

s=' '
if s.strip()=='':
print 's is null'

或者
if not s.strip():
print 's is null'

[已验证]

posted @ 2019-08-13 16:45  云深不知、处  阅读(7271)  评论(0编辑  收藏  举报