title: Iterate Function through List
body: <p>I have a function prime(x) that returns True if x is prime and False if x is false.</p>
  
  <p>Is there an efficient way to iterate through a list and if all the members satisfy the function, return True, and otherwise return false?</p>
  
  <p>For the prime example, I wrote:</p>
  
  <pre><code>def primecheck(x):
      for index in xrange(0,len(x)):
          if prime(x[index])==False:
              return False
              break
      return True
  </code></pre>
  
  <p>but I imagine that this is inefficient and there must be a much better way of doing it. </p>
  
  <p>Is there a standard method for iterating a generic function (where I define a generic function as something that evaluates an integer or string to be True or False) through a list without having to do something like the above each time? Or even if there isn't a standard method, is there a more efficient method than running through the index of the list?</p>