0

I want to sort this dictionary d based on integer keys.

d = { '123': 'aaa',
      '124': 'bbb,
      '125': 'ccc',
    }

So final dictionary would look like this.

d = { '125': 'ccc',
      '124': 'bbb',
      '123': 'aaa,
    }

I know that Dictionaries do not have any inherent order. But is it achievable?

Arun
  • 782
  • 2
  • 13
  • 25

0 Answers0