I have a method that list some versions of an application on my computer, the list following has this format and the content are strings:
['1.15.1.23', '1.10.1.34', '1.9.2.3', ...]
When I call sorted(mylist)
, the output does not appear to sort some items, I'm getting this:
['1.15.1.51', '1.15.1.9', '1.15.2.11', '1.15.2.6']
What I'm doing wrong? I expected the output as:
['1.15.1.9', '1.15.1.51', '1.15.2.6', '1.15.2.11']