import json
x = {
"name": "Bill",
"age": 63,
"married": True,
"divorced": False,
"children": ("Jennifer","Rory","Phoebe"),
"pets": None,
"cars": [
{"model": "Porsche", "mpg": 38.2},
{"model": "BMW M5", "mpg": 26.9}
]
}
# 使用 . 和空格分隔对象,并用空格、= 和空格分隔键与值:
print(json.dumps(x, indent=4, separators=(". ", " = ")))