python json.dumps pretty print

JavaScript
json.dumps(x, indent=4)
Source

Also in JavaScript: