-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' –