在Python 2.6.4中:
>>> '' > 0 True
这是为什么?
python logic operators python-2.x
为什么在Python 2 中4 < '3'返回True?
4 < '3'
True
是因为当我在一个数字周围放置单引号时,Python认为它是一个字符串,字符串比数字大吗?
python comparison operators python-2.x
operators ×2
python ×2
python-2.x ×2
comparison ×1
logic ×1