I am new to Python and I am playing with JSON data. I would like to dynamically build a JSON object by adding some key-value to an existing JSON object.
I tried the
You can create the Python dictionary and serialize it to JSON in one line and it's not even ugly.
my_json_string = json.dumps({'key1': val1, 'key2': val2})