title: Correct way to store this JSON in python?
body: <p>I am trying to store the JSON object returned from the website <a href="https://www.xkcd.com/info.0.json" rel="nofollow">https://www.xkcd.com/info.0.json</a></p>
  
  <p><strong>What I have tried</strong></p>
  
  <pre><code>url = 'https://www.xkcd.com/info.0.json'
  response = requests.get(url)
  if response.status_code == 200:
      response_content = str(response.json())
      print(response_content)
      new_response = response_content.replace("'", '"')
      json_data = json.loads(new_response)
      print(new_response)
      print(json_data)
  </code></pre>
  
  <p><code>print(response_content)</code> returns </p>
  
  <pre><code>{
      'link': '',
      'month': '11',
      'num': 1603,
      'title': 'Flashlights',
      'safe_title': 'Flashlights',
      'year': '2015',
      'day': '13',
      'img': 'http: //imgs.xkcd.com/comics/flashlights.png',
      'transcript': '',
      'news': '',
      'alt': "Due to a typo, I initially found a forum for serious Fleshlight enthusiasts, and it turns out their highest-end models are ALSO capable of setting trees on fire. They're impossible to use without severe burns, but some of them swear it's worth it."
  }
  </code></pre>
  
  <p>To convert the single quotations in <code>response_content</code>, I tried </p>
  
  <pre><code>new_response = response_content.replace("'", '"')
  </code></pre>
  
  <p>But the problem arises with the line where <code>alt</code> is</p>
  
  <pre><code>    .....
      "news": "",
      "alt": "Due to a typo, ...... of setting trees on fire. They"reimpossibletousewithoutsevereburns,
  butsomeofthemswearit"s worth it.",
  }
  </code></pre>
  
  <p>If there are single quotes inside any of the values, this approach fails.</p>
  
  <p><strong>Error log :</strong> </p>
  
  <pre><code> File "./main.py", line 55, in download_latest
      json_data = json.loads(new_response)
    File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
      return _default_decoder.decode(s)
    File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    File "/usr/lib/python3.4/json/decoder.py", line 359, in raw_decode
      obj, end = self.scan_once(s, idx)
  ValueError: Expecting ',' delimiter: line 1 column 342 (char 341)
  </code></pre>
  
  <p>Any other approach for loading the JSON inside the script?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>I want to do something like </p>
  
  <pre><code>    json_data = json.dumps(response_content)
      print(type(json_data))     ## returns &lt;class 'str'&gt;
      print(json_data['num'])    
  </code></pre>
  
  <p>But this returns a <code>TypeError</code></p>
  
  <pre><code>File "./main.py", line 53, in download_latest
      print(json_data['num'])
  TypeError: string indices must be integers
  </code></pre>