title: Add values to JSON object in Python
body: <p>I've got a valid JSON object, with a number of bike accidents listed:</p>
  
  <pre><code>{
     "city":"San Francisco",
     "accidents":[
        {
           "lat":37.7726483,
           "severity":"u'INJURY",
           "street1":"11th St",
           "street2":"Kissling St",
           "image_id":0,
           "year":"2012",
           "date":"u'20120409",
           "lng":-122.4150145
        },
  
     ],
     "source":"http://sf-police.org/"
  }
  </code></pre>
  
  <p>I'm trying to use the json library in python to load the data and then add fields to the objects in the "accidents" array.  I've loaded my json like so:</p>
  
  <pre><code>with open('sanfrancisco_crashes_cp.json', 'rw') as json_data:
     json_data = json.load(json_data)
     accidents = json_data['accidents']
  </code></pre>
  
  <p>When I try to write to the file like so:</p>
  
  <pre><code>for accident in accidents:
     turn = randTurn()
     accidents.write(accident['Turn'] = 'right')
  </code></pre>
  
  <p>I get the following error:  SyntaxError: keyword can't be an expression</p>
  
  <p>I've tried a number of different ways. How can you add data to a JSON object using Python?</p>