title: How to calculate sum of prime numbers from list of integers in Python?
body: <p>I am struck and need help with this..
  I want to find the sum of prime numbers from a given list of integers. Here are a few test cases for the same. </p>
  
  <pre><code>n([3,3,1,13])
  
  19
  
  n([2,4,6,9,11])
  
  13
  
  n([-3,0,1,6])
  
  0
  </code></pre>
  
  <p>The Code that I have written is as follows but it fails with the test cases above..</p>
  
  <pre><code>def sumprimes(n):
      sum1 = 0
      for i in range(0,len(n)):
          num = n[i]
          if num &gt; 1:
              for j in range(2, int(num**0.5)+1):
                  if num%j != 0:
                      sum1 = sum1 + num
          else:
              sum1 = 0
      return(sum1)
  </code></pre>