String comparison technique used by Python

前端 未结 7 1975
心在旅途
心在旅途 2020-11-21 15:50

I\'m wondering how Python does string comparison, more specifically how it determines the outcome when a less than (<) or greater than (>) op

相关标签:
7条回答
  • 2020-11-21 16:13

    Strings are compared lexicographically using the numeric equivalents (the result of the built-in function ord()) of their characters. Unicode and 8-bit strings are fully interoperable in this behavior.

    0 讨论(0)
提交回复
热议问题