tmpName = ''
if tmpName:
print tmpName
#没有输出
if tmpName is not None:
print tmpName
#有输出,是空行

python 直接if判断和is not None的区别

相关文章: