title: Best method to delete an item from a dict
body: <p>In Python there are at least two methods to delete an item from a dict using a key.</p>
  <pre><code>d = {&quot;keyA&quot;: 123, &quot;keyB&quot;: 456, &quot;keyC&quot;: 789}
  
  #remove via pop
  d.pop(&quot;keyA&quot;)
  
  #remove via del
  del d[&quot;keyB&quot;]
  </code></pre>
  <p>Both methods would remove the item from the dict.</p>
  <p>I wonder what the difference between these methods is and in what kinds of situations I should use one or the other.</p>