Are the lists with string elements doing Lexicographical comparison below:
v = ['AB', 'C'] > ['A', 'C']
print(v)
# True
Equivalent to the below?:
v = ['A', 'B', 'C'] > ['A', '', 'C']
print(v)
# True
Are the lists with string elements doing Lexicographical comparison below:
v = ['AB', 'C'] > ['A', 'C']
print(v)
# True
Equivalent to the below?:
v = ['A', 'B', 'C'] > ['A', '', 'C']
print(v)
# True
Yes. Comparison is described here: 6. Expressions — Python 3.14.0 documentation
Caveat: Lexicographically by Unicode code point, so if you were hoping for the collation sequence of a particular natural language I think you’re out of luck. (But there is surely a package for that.).
Each string is compare from the list element by element.
no it does not turn [‘AB’] into [‘A’, ‘B’]
(Sorry for the smart quotes messing up things)