title: How to obtain the solution of the matrix in this Gauss Elimination
body: <pre><code>A=[[1,1,8],[2,-1,1]]
  def triangular(A):
  
  
      n = len(A) 
      for i in range(n):
  
          pivot = A[i][i]
          for j in range(i+1, n): 
              m = -A[j][i]/pivot
              for k in range(i, n+1): 
                  A[j][k] += m*A[i][k]
  def substitui(A):
      n = len(A) 
      x = n*[0] 
      for i in range(n-1, -1, -1):
  
          s = sum([A[i][j]*x[j]
          for j in range(i+1,n)])
          x[i] = (A[i][n] - s)/A[i][i]
          return x
  
  
  def resolve(A):
  
      triangular(A)
      x = substitui(A)
      return x
  
  print(resolve(A))
  </code></pre>
  
  <p>How to obtain the solution of this matrix A? I can not understand why it is going wrong, the solution is giving the values of x = [0,5] instead of x = [3,5]. Someone can give me a help with this problem?</p>