字符串和整数不等式

2024-04-23 09:18:51 发布

您现在位置:Python中文网/ 问答频道 /正文

Possible Duplicate:
How does Python compare string and int?

我今天在Python中遇到了一个奇怪的比较。我发现了:

'101' > -1
True

'101' < -1
False

'101' > 100
True

'101' < 100
False

'101' < 1
False

我不确定这些表达式在测试什么。任何提示都会有帮助。


Tags: andfalsetruestring表达式howintcompare