OnlinePython

JSON Data Exercise

Question 1 of 4

Which function converts a Python dictionary to a JSON string?

import json

data = {"name": "Alice", "age": 30}
# Convert to JSON string
result = ?
print(result)