Nonetype和空值是不一致的,可以理解为Nonetype为不存在这个参数,空值表示参数存在,但是值为空
if hostip is None:
print "no hostip,is nonetype"
elif hostip:
print "hostip is not null"
else:
print " hostip is null"
Nonetype和空值是不一致的,可以理解为Nonetype为不存在这个参数,空值表示参数存在,但是值为空
if hostip is None:
print "no hostip,is nonetype"
elif hostip:
print "hostip is not null"
else:
print " hostip is null"