The standard sorting in Python depends on a comparison operator. A
quick and easy comparison operator that Python uses for strings is
lexicographic ordering:
http://en.wikipedia.org/wiki/Lexicographical_order
The quick and dirty rule is: dictionary order, with each character
consistently tre
On 01.06.2013 07:47, Sarma Tangirala wrote:
I had a quick question on how string compare works. If did '1001' <= '999'
I get true. I know how the string compare works but I was wondering why it
were so. Why doesn't the string length factor into the comparison?
Because usually you are interested
Sarma Tangirala wrote:
> I had a quick question on how string compare works. If did '1001' <= '999'
> I get true. I know how the string compare works but I was wondering why it
> were so. Why doesn't the string length factor into the comparison? For
> example, If I compared character-by-character
Hi,
I had a quick question on how string compare works. If did '1001' <= '999'
I get true. I know how the string compare works but I was wondering why it
were so. Why doesn't the string length factor into the comparison? For
example, If I compared character-by-character but also found how differen