python null 和None
python没有null,用None
None是没有像len,size等属性的,要判断一个变量是否为None,直接使用
if test is None:
python是把0,空字符串‘ ’,空列表[]和None都看作False,把其他数值和非空字符串都看作True
python没有null,用None
None是没有像len,size等属性的,要判断一个变量是否为None,直接使用
if test is None:
python是把0,空字符串‘ ’,空列表[]和None都看作False,把其他数值和非空字符串都看作True