-5
我是python的新手,并且正在尝试学习基础知识。我发现一个奇怪的行为与蟒蛇解释器:比较python中的字符串和<comparision运算符
>>> 'Pp' < 'Pn'
False # --> expected p comes after n
>>> 'Pap' < 'Pbn'
True # --> though a < b, p is not < n. How can this result as True?
有人请解释?
这是字母顺序。 – Squidly
在辞典'http:// en.wikipedia.org/wiki/Lexicographical_order' –