title: How to dynamically build a JSON object?
body: <p>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.</p>
  
  <p>I tried the following but I get <code>TypeError: 'str' object does not support item assignment</code>:</p>
  
  <pre><code>import json
  
  json_data = json.dumps({})
  json_data["key"] = "value"
  
  print 'JSON: ', json_data
  </code></pre>