I'm trying to come up with a specific order key in Python to sort my list of string numbers with specific criteria. The list elements all look like this:
["5,4287", "2,86", "4,92", "6,12", "6,11"]
and so on.
I want the elements of this list to be ordered in a specific order of criteria:
- First order them by the prefix (the number before ',')
- Then order them by the suffix
The resulting list should look like this:
["2,86", "4,92", "5,4287", "6,11", "6,12"]
I don't know how I can sort by multiple criteria in python or if this is even possible.