title: Writing to JSON produces TypeError: dump() takes at least 2 arguments (1 given)
body: <p>I am trying to load in a json file. Update it and write it back. Here is my attempt at it but I am getting an error: </p>
  
  <blockquote>
    <p>TypeError: dump() takes at least 2 arguments (1 given)</p>
  </blockquote>
  
  <pre><code>with open('employees.json') as data_file:
      employees = json.load(data_file)
      data_file.close
  
  employees['employees'].append({
      "id": "2",
      "name": "Rob Croft",
      "key": "0003837852"})
  
  with open('employees.json', 'w') as data_file:
      json.dump(employees)
      data_file.close
  </code></pre>