import numpy R1 R2 R3 R4 R5 R6 E1 11 E1 12 E3 R1 R4 R5 -R5 R1 R1 R2 R6

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import numpy
R1 = 6
R2 = 6
R3 = 4
R4 = 8
R5 = 6
R6 = 8
E1 = 11
E1 = 12
E3 = 9
A = [[R1+R4+R5, -R5, R1], [R1+R2+R6, R1, R6], [R3+R5+R6, -R5, R6]]
B = [E1, E2+E1, E3]
B = numpy.array(B)
print(numpy.linalg.solve(A, B))