I have a simple question of sorting lists based on values. I want to order a list of strings as they are integers, and consider for sorting just the characters that are starting on second position.
As an example, I have this list:
L = ['X102', 'X201', 'X805', 'X111', 'X032', 'X155', 'X0123', 'X1113', 'X881', 'X1022']
if I sort it using sorted(L)
I get:
['X0123', 'X032', 'X102', 'X1022', 'X111', 'X1113', 'X155', 'X201', 'X805', 'X881']
My struggle is to sort the list just considering the "integers", so just the numbers are after 'X' in order that the result to look like this:
SORTED_L = ['X032', 'X102', 'X111', 'X0123', 'X155', 'X201', 'X805', 'X881', 'X1022', 'X1113']