title: How to loop through a dictionary to remove values that match a string?
body: <p>I want to remove values from a dictionary if they contain a particular string and consequentially remove any keys that have an empty list as value.</p>
  
  <pre><code>mydict = {
      'Getting links from: https://www.foo.com/': 
      [
          '+---OK--- http://www.this.com/',
          '+---OK--- http://www.is.com/',
          '+-BROKEN- http://www.broken.com/',
          '+---OK--- http://www.set.com/',
          '+---OK--- http://www.one.com/'
      ],
      'Getting links from: https://www.bar.com/': 
      [
          '+---OK--- http://www.this.com/',
          '+---OK--- http://www.is.com/',
          '+-BROKEN- http://www.broken.com/'
      ],
      'Getting links from: https://www.boo.com/':
      [
          '+---OK--- http://www.this.com/',
          '+---OK--- http://www.is.com/'
      ]
  }
  
  val = "is"
  
  for k, v in mydict.iteritems():
     if v.contains(val):
       del mydict[v]
  </code></pre>
  
  <p>The result I want is:</p>
  
  <pre><code>{
      'Getting links from: https://www.foo.com/':
      [
          '+-BROKEN- http://www.broken.com/',
          '+---OK--- http://www.set.com/',
          '+---OK--- http://www.one.com/'
      ], 
      'Getting links from: https://www.bar.com/': 
      [
          '+-BROKEN- http://www.broken.com/'
      ]
  }
  </code></pre>
  
  <p>How can I remove all dictionary values that contain a string, and then any keys that have no values as a result?</p>