Challenge 1
Convert the Python value to a JSON string.
import json
data = {"name": "Ada", "score": 10}
text =
print(text)
Press Ctrl⌘Enter to check your answer
Practice serializing Python data, reading JSON text, and working with JSON files.
Challenge 1
import json
data = {"name": "Ada", "score": 10}
text =
print(text)
Press Ctrl⌘Enter to check your answer
Challenge 2
import json
text = '[1, 2, 3]'
data =
print(data)
Press Ctrl⌘Enter to check your answer
Challenge 3
import json
value = {"ready": True}
with open("data.json", "w", encoding="utf-8") as file:
Press Ctrl⌘Enter to check your answer
Challenge 4
import json
with open("data.json", encoding="utf-8") as file:
value =
print(value)
Press Ctrl⌘Enter to check your answer