title: Count occurrences of a substring in a list of strings
body: <p>I know that counting the simple occurrences of a list item is as easy as:</p>
  
  <pre><code>&gt;&gt;&gt; [1, 2, 3, 4, 1, 4, 1].count(1)
  3
  </code></pre>
  
  <p>But what I would like to know how to do is count every time a string appears in a substring of list entries.</p>
  
  <p>For example, I want to see how many times <code>foo</code> appears in the list <code>data</code>:</p>
  
  <pre><code>data = ["the foo is all fooed", "the bar is all barred", "foo is now a bar"]
  </code></pre>
  
  <p>Doing: </p>
  
  <pre><code>d_count = data.count('foo')
  print("d_count:", d_count)
  </code></pre>
  
  <p>produces:</p>
  
  <pre><code>d_count: 0
  </code></pre>
  
  <p>but I expect to get:</p>
  
  <pre><code>d_count: 2
  </code></pre>
  
  <p>I also tried doing:</p>
  
  <pre><code>d_count = data.count(any('foo' in s for s in data))
  print("d_count:", d_count)
  </code></pre>
  
  <p>but that also gives zero as a result.</p>
  
  <p>I would like to know how to count each occurrence of substring appearances in a list. </p>