1

I am new to python. I want to convert given string into json and I found json.loads() method to do that. But it generates json data in random order, i need them in orders because i am working with keys() and values() method of json.
Here is what I tried in the terminal:

    >> json.loads('{"a":"a","w":"w","b":"b","c":"c"}')
    >> {'b': 'b', 'w': 'w', 'c': 'c', 'a': 'a'}

Here the order in the json is jumbled. I want them in the same order I provided.

Ulf Gjerdingen
  • 1,414
  • 3
  • 16
  • 20
rosuchakre
  • 101
  • 2
  • 9

0 Answers0