Can anybody please tell me why the string comparisons below deliver these results?
>>\"1040\"<=\"12000\" True >> \"1040\"<=\"1
You're experiencing lexicographical ordering.
There are some generalized algorithms for this ordering in the book Elements of Programming. Search for the word lexicographical.
lexicographical