title: How to save a string to a json file
body: <p>I want to save a string to a json file, but when I do it will write it with <code>\"</code> and with quotes at the beginning and at the end. </p>
  
  <pre class="lang-py prettyprint-override"><code>import json
  
  name_c = ['Don', 'Perez']
  
  my_details = "data = {" + "\"name\": " + name_c[0] + ", \"lastname\": " + name_c[1] + "}"
  
  print(my_details)
  
  with open('personal.json', 'w') as outfile:
      json.dump(my_details, outfile)
  </code></pre>
  
  <p>I would like this kind of text in the json file:</p>
  
  <pre><code>data = {"name": Don, "lastname": Perez}
  </code></pre>
  
  <p>and I'm getting this kind of text in the json file</p>
  
  <pre><code>"data = {\"name\": Don, \"lastname\": Perez}"
  </code></pre>