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

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

 

posted on 2017-02-10 16:47  星河赵  阅读(169567)  评论(0编辑  收藏  举报

导航