Python List Exclusions
<p>I have a dictionary of lists with info such as <code>var1=vara</code>, <code>var1=varb</code>, <code>var2=vara</code> etc. This can have lots of entries, and I print it out ok like this  </p>

<pre><code>for y in myDict:  
    print(y+"\t"+myDict[y])
</code></pre>

<p>I have another list which has exclusions in like this var2, var3 etc. This may have &lt; 10 entries and I can print that ok like this  </p>

<pre><code>for x in myList:
    print(x)
</code></pre>

<p>Now I want to remove occurrences of key val pairs in the dictionary where the keys are the list values. I tried this  </p>

<pre><code>for x in myList:
    for y in myDict:
        if x != y: print(y+"\t"+myDict[y])
</code></pre>

<p>but on each pass through the list it lets all the others apart from the current `x  to the screen  </p>

<p>Is there a nice python way to remove the key val pairs from the dictionary if the key exists in the list?</p>
