python--字符串为空
时间:2014-06-25 00:57:06
收藏:0
阅读:240
str1 = "" str2 = None str3 = "hello" if str2: print "not null" else: print "null"
这样,不仅可以判定字符串是否为空,还能判定是否为None
评论(0)