Message320844
This isn't a bug: I'm guessing that you expected an output of `['6', '8', '10']`, but in the example you give you're sorting strings rather than numbers, and those strings are sorted lexicographically (i.e., using "dictionary order") as normal.
If you want to do a numeric sort, convert your inputs to numbers first.
>>> lista4 = ['6', '8', '10']
>>> lista4_numbers = [int(s) for s in lista4]
>>> lista4_numbers.sort()
>>> lista4_numbers
[6, 8, 10] |
|
Date |
User |
Action |
Args |
2018-07-01 20:06:35 | mark.dickinson | set | recipients:
+ mark.dickinson, lucassdssampaio |
2018-07-01 20:06:35 | mark.dickinson | set | messageid: <1530475595.37.0.56676864532.issue34016@psf.upfronthosting.co.za> |
2018-07-01 20:06:35 | mark.dickinson | link | issue34016 messages |
2018-07-01 20:06:35 | mark.dickinson | create | |
|