title: Python 3 - counting matches in two lists (including duplicates)
body: <p>First of all, I'm new to programming and python, I've looked here but can't find a solution, if this is a stupid question though please forgive me!</p>
  
  <p>I have two lists and I'm trying to determine how many times items in the second list appears in the first list.</p>
  
  <p>I have the following solution:</p>
  
  <pre><code>    list1 = ['black','red','yellow']
      list2 = ['the','big','black','dog']
      list3 = ['the','black','black','dog']
      p = set(list1)&amp;set(list2)
      print(len(p))
  </code></pre>
  
  <p>It works fine apart from when the second list contains duplicates.</p>
  
  <p>i.e. list1 and list2 above returns 1, but so does list1 and list3, when ideally that should return 2</p>
  
  <p>Can anyone suggest a solution to this? Any help would be appreciated!</p>
  
  <p>Thanks,</p>
  
  <p>Adam</p>