Q:

Convert the following dictionary into JSON format using python programming

belongs to collection: Python JSON Exercises

0

Convert the following dictionary into JSON format

data = {"key1" : "value1", "key2" : "value2"}

Expected Output:

data = {"key1" : "value1", "key2" : "value2"}

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

import json

data = {"key1" : "value1", "key2" : "value2"}

jsonData = json.dumps(data)
print(jsonData)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Access the value of key2 from the following JSON u... >>