list = ['c:8', 'c:9', 'c:13', 'c:19', 'c:2', 'c:3', 'c:0', 'c:1', 'c:6', 'c:7', 'c:4', 'c:5', 'c:14', 'c:18', 'c:17', 'c:12', 'c:15', 'c:11', 'c:10', 'c:16', 'c:20']
I used "sorted()" but get this result
['c:0', 'c:1', 'c:10', 'c:11', 'c:12', 'c:13', 'c:14', 'c:15', 'c:16', 'c:17', 'c:18', 'c:19', 'c:2', 'c:20', 'c:3', 'c:4', 'c:5', 'c:6', 'c:7', 'c:8', 'c:9']
But what I want is
['c:0', 'c:1', 'c:2', 'c:3', 'c:4', 'c:5', 'c:6', 'c:7', 'c:8', 'c:9', 'c:10', 'c:11', 'c:12', 'c:13', 'c:14', 'c:15', 'c:16', 'c:17', 'c:18', 'c:19','c:20']
Besides getting what I want, I want why sorted()
could not work.