python json dump format

Solutions on MaxInterview for python json dump format by the best coders in the world

showing results for - "python json dump format"
Isabella
08 Apr 2019
1>>> import json
2>>>
3>>> your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]'
4>>> parsed = json.loads(your_json)
5>>> print(json.dumps(parsed, indent=4, sort_keys=True))
6[
7    "foo", 
8    {
9        "bar": [
10            "baz", 
11            null, 
12            1.0, 
13            2
14        ]
15    }
16]
17