title: count prime number in a list
body: <p>In Python 3, I am trying to write a function that counts the number of prime number in a list, can anyone help me with that? </p>
  
  <pre><code>def function(x):
  
    array = []
    aa = len(x)
  
    for num in x :
      if (num == 1 or num ==2):
        array.append()
      elif num &gt;2:
        for i in range (2, aa):
          if (num % i )== 0:
            array.append()
          else:
            print (num)
            array.append(num)
  
    return len(array)
  
  z = [4,5,6,7,8,9,10]
  print (function(z))
  </code></pre>
  
  <p>but it shows an incorrect result! </p>