title: Find if matrix is diagonally dominant or not in python 3.6
body: <p>I am trying to find if the matrix is diagonally dominant or not.
  I have developed a code which as follows.</p>
  
  <pre><code>sum=0
  def isDiagonallyDominantMatrix(A):
      global sum
      for i in range(len(A)):
          for j in range(len(A)):
              sum=sum+abs(A[i][j])
              diag=abs(A[i][i])
              non_diag=sum-diag
              if((diag&lt;non_diag)):
                  return 0
      return 1
  A=[[7,2,1],[1,7,2],[1,2,7]]
  if(isDiagonallyDominantMatrix(A)):
      print('yes')
  else:
      print('no')
  </code></pre>
  
  <p>whenever I run the above code, 'no' is displayed although the A matrix is diagonally dominant.can you plz help where I am making a mistake</p>