def rowadd(matlist, index1, index2, k, K):
 result = []
 for i in range(len(matlist[index1])):
  matlist[index1][i] = (matlist[index1][i] + (k * matlist[index2][i]))
 return matlist

def rowadd ( matlist , index1 , index2 , k , K ) : result = [ ] for i in range ( len ( matlist [ index1 ] ) ) : matlist [ index1 ] [ i ] = ( matlist [ index1 ] [ i ] + ( k * matlist [ index2 ] [ i ] ) ) return matlist
adds the index1 row with index2 row which in turn is multiplied by k .