That depends on the format you have them in and how you want to store them. If it’s just a string, you could split on whitespace and sort on the second field cast to an integer. If they’re already in a dictionary or a tuple you’d do something else.