I admit I dont know how to give this question a better title. :-( Anybody has a better idea for the title?
Here is my problem:
I want to sort this list:
a = ['at10', 'at11', 'at12', 'at13', 'at9', 'at1', 'at8']
Every item from the list begins with two letters and has some numbers.
The desired result is as followings. The list is sorted by numbers.
['at1', 'at8', 'at9', 'at10', 'at11', 'at12', 'at13']
I tried with sorted(a)
and many of its key
settings. But I could not get the result. Anybody please help me out? Thanks in advance!