title: How to add an element to an empty JSON in python?
body: <p>I created an empty string &amp; convert it into a JSON by <code>json.dump</code>. Once I want to add element, it fails &amp; show</p>
  
  <blockquote>
    <p>AttributeError: 'str' object has no attribute 'append'</p>
  </blockquote>
  
  <p>I tried both <code>json.insert</code> &amp; <code>json.append</code> but neither of them works.</p>
  
  <p>It seems that it's data type problem. As Python can't declare data type as Java &amp; C can, how can I avoid the problem?</p>
  
  <pre><code>import json
  
  data = {}
  json_data = json.dumps(data)
  json_data.append(["A"]["1"])
  print (json_data)
  </code></pre>