import json data = {} data['key1'] = 'value1' data['key2'] = 'value2' json_data = json.dumps(data) print(json_data)
{"key1": "value1", "key2": "value2"}
Comment here