Fill: JSON Dumps
Fill in the Blank Easy
Question
Fill in the blank to convert the dict to a JSON string.
Code
import json
data = {"name": "Alice"}
json_str = json.___(data)
Hint
dumps = dump string.
Explanation
json.dumps() (dump string) converts a Python object to a JSON-formatted string. json.dumps({'name': 'Alice'}) = '{"name": "Alice"}'. Use json.dump() to write to a file.
Related Resources
Related Lessons
- JSON Handling
json.dumps().
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.