title: How to remove a key/value pair in python dictionary?
body: <p>Say I have a dictionary like this :</p>
  
  <pre><code>d = {'ben' : 10, 'kim' : 20, 'bob' : 9}
  </code></pre>
  
  <p>Is there a way to remove a pair like <code>('bob',9)</code> from the dictionary?
  I already know about <code>d.pop('bob')</code> but that will remove the pair even if the value was something other than <code>9</code>.</p>
  
  <p>Right now the only way I can think of is something like this :</p>
  
  <pre><code>if (d.get('bob', None) == 9):
      d.pop('bob')
  </code></pre>
  
  <p>but is there an easier way? possibly not using if at all</p>