Quote:
I am getting 6 -214
Just a guess: you forgot to convert each element of
li
to numbers.
numbers
is a string, after split, you get a list of strings. Since you want to compare integer values of strings, you need to covert the list of strings to a list of integers.
Quote:
Why in string "6" is greater than others? How max function works on string. In my opinion it uses the number of charaters in the string but this does seem to be the case here.
Sorted strings are in same order as words in a dictionary.
-24 < -52 < 1 < 11 < 15 < 2 < 25< 2614 < 3 < 33 < 4