Answers for "fomat json load python"

0

fomat json load python

import json

your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]'
parsed = json.loads(your_json)
print(json.dumps(parsed, indent=4, sort_keys=True))

#output:
'''
[
    "foo", 
    {
        "bar": [
            "baz", 
            null, 
            1.0, 
            2
        ]
    }
]
'''
Posted by: Guest on July-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language