title: python function to find sum of positive numbers in an array
body: <p>i need to write a function that takes an array of numbers and finds the maximum sum of all the numbers. In other words, I need to find the sum of just the positive numbers. I wrote this, I'm getting "list is out of range"</p>
  
  <p>thoughts?</p>
  
  <pre><code>    def maximum_sub(A):
          x = 0
          i = 0
          for i in A:
              while A[i] &gt; 0:
              x+=A[i]
              i+=1
          return x
  </code></pre>