title: Python read json response and append
body: <p>I have developed a post request with requests module and I retrieve a JSON, this is code</p>
  
  <pre><code>headers_ = {'Authorization': acc_token}
      params_ = (('start_time', '2016-08-01T00:00:00+00:00'),('limit', '2'))
  
      r = requests.get('https://server.com/API/v1', headers=headers_, params=params_)
      data_ = r.json()
      json_result = (json.dumps(data_, indent=4, sort_keys=False))
  </code></pre>
  
  <p>and this is json result</p>
  
  <pre><code>{
  "loc":[
    {
       "origin":{
          "lat":39.72417,
          "lng":-104.99984,
          "eta_seconds":null,
          "address":""
       },
       "destination":{
          "lat":39.77446,
          "lng":-104.9379,
          "eta_seconds":null,
          "address":null
       }
    },
    {
       "origin":{
          "lat":39.77481,
          "lng":-104.93618,
          "eta_seconds":null,
          "address":"10 Albion Street"
       },
       "destination":{
          "lat":39.6984,
          "lng":-104.9652,
          "eta_seconds":null,
          "address":null
       }
    }
  </code></pre>
  
  <p>]
  }
  now I'm trying to append into array the lat and lng value of each json items array and I have try with this code</p>
  
  <pre><code>for i in json_result:
          print(i['loc']['origin']['lat'])
          dict.append(i['loc']['origin']['lat'])
  </code></pre>
  
  <p>but I have this error
  TypeError: string indices must be integers, not str</p>
  
  <p>How can I retrieve the value lat and lng for each element of the array and append into dict?</p>
  
  <p>Thanks</p>