【问题标题】:Why does 'a' > 'A' evaluates to True in Python? [duplicate]为什么 'a' > 'A' 在 Python 中的计算结果为 True? [复制] 【发布时间】:2020-02-08 14:35:23 【问题描述】: 我正在学习 Python 中的逻辑运算符。为什么上面的表达式计算结果为 True。 【问题讨论】: 标签: python python-3.x string char string-comparison 【解决方案1】: 因为每个 Unicode 字符都与一个代码点值相关联: ord('a') 是 97 和 ord('A') 是 65 见Unicode HOWTO和ord() 【讨论】: