Python - Structured Data Files
You want to save a Python dictionary data to a JSON file with indentation for readability. Which code is correct?
You want to save a Python dictionary data to a JSON file with indentation for readability. Which code is correct?
json.dump() writes JSON to file, accepts indent parameter for formatting.json.dumps() returns string, not for writing directly to file; load and loads are for reading.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions