title: What is the purpose of the sum(rlist) == len(list) in this code?
body: <p>The problem is Write a function matchAll(pattern, list), return True if the pattern matches all the strings in the list.</p>
  
  <p>The answer is:</p>
  
  <pre><code>import re
  def matchAll(pattern,lst):
      outlist=[(re.search(pattern, i) != None) for i in lst]
      #out = True
      #for i in outlist:
      #    out= i and out
      return sum(outlist)==len(outlist)
  </code></pre>
  
  <p>I understand everything they did except for the last line. Why do you have to check if the sum of the list is equal to the length of the list? Thanks</p>