title: Delete an item from a JSON file
body: <p>I have a JSON file which contains capitals and countries.How do I delete a particular key-value pair?</p>
  
  <p>I have the following JSON file</p>
  
  <pre><code>{
      "data": [
      {
          "Capital": "Berlin",
          "Country": "Germany"
      },
      {
          "Capital": "New Delhi",
          "Country": "India"
      },
      {
          "Capital": "Canberra",
          "Country": "Australia"
      },
      {
          "Capital": "Beijing.",
          "Country": "China"
      },
      {
          "Capital": "Tokyo",
          "Country": "Japan"
      }
      ]
  
  }
  </code></pre>
  
  <p>I want to remove an item</p>
  
  <pre><code> {
      "Capital": "Canberra",
      "Country": "Australia"
   }
  </code></pre>
  
  <p>How do I do it?I have tried my own way of doing it,but doesn't work</p>
  
  <pre><code>with open(filename) as json_data:
          nations = json.load(json_data)['data']
          for x in nations:
              if x['Capital'] == "Canberra":
                  del x['Capital']
  </code></pre>
  
  <p>How do I delete the item then?</p>