Python - Structured Data Files
What is the output of this code?
import json
data = {'a': 1, 'b': 2}
print(json.dumps(data, indent=2, sort_keys=True))import json
data = {'a': 1, 'b': 2}
print(json.dumps(data, indent=2, sort_keys=True))indent=2 and sort_keys=Trueindent=2 adds 2 spaces indentation per level. sort_keys=True sorts keys alphabetically, so 'a' comes before 'b'.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions