Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run ยป
HTML / CSS / JS
import json config = { "database": {"host": "localhost", "port": 5432}, "debug": True, "allowed_hosts": ["localhost", "127.0.0.1"] } json_str = json.dumps(config, indent=2) print(json_str) parsed = json.loads(json_str) print(parsed["database"]["port"]) # 5432 print(type(parsed["allowed_hosts"])) # list
Result
Open