title: How to sum a 2d array in Python?
body: <p><strong>I want to sum a 2 dimensional array in python:</strong></p>
  
  <p>Here is what I have:</p>
  
  <pre><code>def sum1(input):
      sum = 0
      for row in range (len(input)-1):
          for col in range(len(input[0])-1):
              sum = sum + input[row][col]
  
      return sum
  
  
  print sum1([[1, 2],[3, 4],[5, 6]])
  </code></pre>
  
  <p>It displays <code>4</code> instead of <code>21</code> (1+2+3+4+5+6 = 21).  Where is my mistake?</p>