Python how to delete a specific value from a dictionary key with multiple values?
<p>I have a dictionary with multiple values per key and each value has two elements (possibly more). I would like to iterate over each value-pair for each key and delete those values-pairs that meet some criteria. Here for instance I would like to delete the second value pair for the key A; that is: ('Ok!', '0'):</p>

<pre><code>myDict = {'A': [('Yes!', '8'), ('Ok!', '0')], 'B': [('No!', '2')]}
</code></pre>

<p>to:</p>

<pre><code>myDict = {'A': [('Yes!', '8')], 'B': [('No!', '2')]}
</code></pre>

<p>I can iterate over the dictionary by key or value, but can't figure out how I delete a specific value.</p>

<p>The code like this:</p>

<pre><code>myDict = {'A': [('Yes!', '8'), ('Ok!', '0')], 'B': [('No!', '2')]}
for v in myDict.values():
    if ('Ok!', '0') in v:
        v.remove(('Ok!', '0'))
print(myDict)
</code></pre>

python dictionary