I am at the same time impressed with the concise answer and disheartened by my inability to see this myself.
My heartfelt thanks!

On 2009-04-28 10:06:24 +0200, Andre Engels <andreeng...@gmail.com> said:

When sorting strings, including strings that represent numbers,
sorting is done alphabetically. In this alphabetical order the numbers
are all ordered the normal way, so two numbers with the same number of
digits will be sorted the same way, but any number starting with "1"
will come before any number starting with "2", whether they denote
units, tens, hundreds or millions. Thus:

"1" < "15999" < "16" < "2"


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to