0

I created a dictionary as follows -

accounts = {'ICICI':4567898765456,\
    'Citi':89889787868987,\
    'Chase':5678765434567}

And it gave the following result

accounts
{'Citi': 89889787868987L, 'ICICI': 4567898765456L, 'Chase': 5678765434567L}

Well I have observed that the dictionary usually does not store the dictionary in the same order as you declare it when the key is a String.

Is it something to do with how dictionaries are stored in the memory. If so, can someone please illustrate. Is there a way to enforce the order of dictionary as I declare them.

Cavaz
  • 2,996
  • 24
  • 38

0 Answers0