title: Delete the value of a dictionary if the value is the key in python
body: <p>I have a dictionary and I want to delete each value of the dictionary which is the key.
  I want this output: <code>G = {'y': {'z'}, 'z': {'u', 'f', 'y'}, 'u': {'z'}}</code></p>
  
  <pre><code>G = {'y': {'z', 'y'}, 'z': {'z', 'u', 'f', 'y'}, 'u': {'u', 'z'}}
  </code></pre>
  
  <p>I tried this but I know. It's wrong.</p>
  
  <pre><code>for key,value in G.items():
      if key == value:
          del value
  </code></pre>