import numpy as numpy

a = [[10,-2,-1,-1],
     [-2,10,-1,-1],
     [-1,-1,10,-2],
     [-1,-1,-2,10]
]
b = [3,15,27,-9]


x = [0]
y = [0]
z = [0]
p = [0]

for i in range(10):
    x.append(((1/a[0][0])*(b[0]-(a[0][1]*y[i])  - (a[0][2]*z[i]) - (a[0][3]*p[i]))))
    y.append(((1/a[1][1])*(b[1]-(a[1][0]*x[i+1])-(a[1][2]*z[i]) - (a[1][3]*p[i]))))
    z.append(((1/a[2][2])*(b[2]-(a[2][0]*x[i+1])-(a[2][1]*y[i+1]) - (a[2][3]*p[i]))))
    p.append(((1/a[3][3])*(b[3]-(a[3][0]*x[i+1])-(a[3][1]*y[i+1])-(a[3][2]*z[i+1]))))
    print('%.4f\t%.4f\t%.4f\t%.4f\t%0.4f'% (i,x[i],y[i],z[i],p[i]))
    print('------------------------------')


21bde7075e8264d0baae67a819fda9e0af7c58c6
<mask token>

<mask token>
for i in range(10):
    x.append(1 / a[0][0] * (b[0] - a[0][1] * y[i] - a[0][2] * z[i] - a[0][3
        ] * p[i]))
    y.append(1 / a[1][1] * (b[1] - a[1][0] * x[i + 1] - a[1][2] * z[i] - a[
        1][3] * p[i]))
    z.append(1 / a[2][2] * (b[2] - a[2][0] * x[i + 1] - a[2][1] * y[i + 1] -
        a[2][3] * p[i]))
    p.append(1 / a[3][3] * (b[3] - a[3][0] * x[i + 1] - a[3][1] * y[i + 1] -
        a[3][2] * z[i + 1]))
    print('%.4f\t%.4f\t%.4f\t%.4f\t%0.4f' % (i, x[i], y[i], z[i], p[i]))
    print('------------------------------')

<mask token>
a = [[10, -2, -1, -1], [-2, 10, -1, -1], [-1, -1, 10, -2], [-1, -1, -2, 10]]
b = [3, 15, 27, -9]
x = [0]
y = [0]
z = [0]
p = [0]
for i in range(10):
    x.append(1 / a[0][0] * (b[0] - a[0][1] * y[i] - a[0][2] * z[i] - a[0][3
        ] * p[i]))
    y.append(1 / a[1][1] * (b[1] - a[1][0] * x[i + 1] - a[1][2] * z[i] - a[
        1][3] * p[i]))
    z.append(1 / a[2][2] * (b[2] - a[2][0] * x[i + 1] - a[2][1] * y[i + 1] -
        a[2][3] * p[i]))
    p.append(1 / a[3][3] * (b[3] - a[3][0] * x[i + 1] - a[3][1] * y[i + 1] -
        a[3][2] * z[i + 1]))
    print('%.4f\t%.4f\t%.4f\t%.4f\t%0.4f' % (i, x[i], y[i], z[i], p[i]))
    print('------------------------------')

import numpy as numpy
a = [[10, -2, -1, -1], [-2, 10, -1, -1], [-1, -1, 10, -2], [-1, -1, -2, 10]]
b = [3, 15, 27, -9]
x = [0]
y = [0]
z = [0]
p = [0]
for i in range(10):
    x.append(1 / a[0][0] * (b[0] - a[0][1] * y[i] - a[0][2] * z[i] - a[0][3
        ] * p[i]))
    y.append(1 / a[1][1] * (b[1] - a[1][0] * x[i + 1] - a[1][2] * z[i] - a[
        1][3] * p[i]))
    z.append(1 / a[2][2] * (b[2] - a[2][0] * x[i + 1] - a[2][1] * y[i + 1] -
        a[2][3] * p[i]))
    p.append(1 / a[3][3] * (b[3] - a[3][0] * x[i + 1] - a[3][1] * y[i + 1] -
        a[3][2] * z[i + 1]))
    print('%.4f\t%.4f\t%.4f\t%.4f\t%0.4f' % (i, x[i], y[i], z[i], p[i]))
    print('------------------------------')

import numpy as numpy

a = [[10,-2,-1,-1],
     [-2,10,-1,-1],
     [-1,-1,10,-2],
     [-1,-1,-2,10]
]
b = [3,15,27,-9]


x = [0]
y = [0]
z = [0]
p = [0]

for i in range(10):
    x.append(((1/a[0][0])*(b[0]-(a[0][1]*y[i])  - (a[0][2]*z[i]) - (a[0][3]*p[i]))))
    y.append(((1/a[1][1])*(b[1]-(a[1][0]*x[i+1])-(a[1][2]*z[i]) - (a[1][3]*p[i]))))
    z.append(((1/a[2][2])*(b[2]-(a[2][0]*x[i+1])-(a[2][1]*y[i+1]) - (a[2][3]*p[i]))))
    p.append(((1/a[3][3])*(b[3]-(a[3][0]*x[i+1])-(a[3][1]*y[i+1])-(a[3][2]*z[i+1]))))
    print('%.4f\t%.4f\t%.4f\t%.4f\t%0.4f'% (i,x[i],y[i],z[i],p[i]))
    print('------------------------------')

