What is the proper way of deleting item from a dictionary  in "for" loop (Python)?
<p>I want to iterate a dictionary, examine the value and delete items that matches certain values. </p>

<p>Example</p>

<pre><code>d = {1, 1, 2, 1, 4, 5}   
for i in d:
  if i == 1:
    del i
</code></pre>

<p>But we know doing this is dangerous since the list is updated while it is been iterated. What is clean way of doing this in Python?</p>
