I would like to sort strings by numbers, but keep them in groups. Means, keep Cs, Rs, ... together, but in a numeric sorted order. There are similar questions like here Is there a built in function for string natural sort?, but all of them are dealing with strings starting with the same string. So this is little bit different.
# input
a = ['C2', 'C1', 'R3', 'R21', 'C10', 'R1', 'L1']
# expected output
['C1', 'C2', 'C10', 'R1', 'R3', 'R21', 'L1']
# I tried multiple options, but didn't find the right one.
a.sort(key=lambda x: int(x[1:]))
So how to get the results without creating the special parsing function?
Thanks