What does json.dumps(obj, indent=2) do in Python?
Correct answer
D. Pretty-prints JSON with 2-space indentation
D. Pretty-prints JSON with 2-space indentation
The indent parameter formats output for readability.
Asked in: Python Interview Standard Library
https://docs.python.org/3/library/index.htmlNot sure why the answer is D? Ask here and get an explanation.