Editor

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 lesson

What 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

All Python exercises · 50 practice problems · File I/O & Data Formats quiz