Predict the JSON Output
Beginner · Predict the output · from Python JSON: Parse, Create, and Manipulate JSON Data
From the lesson: Python JSON: Parse, Create, and Manipulate JSON Data
Imagine a universal language that every app, website, and database can understand. That's JSON (JavaScript Object Notation). It's the most popular format for sending data between computers.
Read the lessonWhat does this code print? Pay attention to how Python types map to JSON.
import json
data = {'active': True, 'score': None}
result = json.dumps(data)
print(result)import json
data = {'active': True, 'score': None}
result = json.dumps(data)
print(result)
More JSON exercises
- Parse a JSON StringBeginner
- Create Pretty JSONIntermediate
- Fix the JSON Parsing BugIntermediate
- Refactor String Concatenation to json.dumpsIntermediate
- Extract Data from Nested API JSONAdvanced
All Python exercises · 50 practice problems · File I/O & Data Formats quiz