Sort Dictionary Keys in natural order [duplicate]
问题 This question already has answers here : How can I sort a dictionary by key? (25 answers) Closed 5 years ago . I want to sort dictionary keys in a "natural order". If I have a dictionary with the keys d = {"key1" : object, "key11" : object, "key2" : object, "key22" : object", "jay1" : object, "jay2" : object} I want to sort this dictionary so the result is: d = { "jay1" : object, "jay2" : object, "key_1" : object, "key_2" : object, "key_11" : object, "key_22" : object"} 回答1: You can change