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

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

猜你喜欢

转载自www.cnblogs.com/artesian0526/p/9267906.html