如果not ''评估为True,为什么'' == False评估为False?
not ''
True
'' == False
False
例如,其他类型的(例如,0,0.0)将返回的"空隙" True时相比False:
>>> 0 == False True >>> 0.0 == False True
谢谢
python string logic boolean
boolean ×1
logic ×1
python ×1
string ×1