# Python solve linear equation with substitution

I am trying to learn Python for a physics class, but I have tried to code the function of

E_{1} - i_{1}R_{1} + i_{3}R_{3} = 0;

-i_{3}R_{3} - i_{2}R_{2} - E_{2} = 0;

and E_{1} - i_{1}R_{1} - i_{2}R_{2} - E_{2} = 0.

And solve it by using a matrix. The variables are given to be E_{1} = 5V, E_{2} = 3V, R_{1} = 10 Ohms, R_{2} = 15 Ohms, and R_{3} = 5 Ohms.

Find i_{1}, i_{2}, and i_{3}. Please help me. This is a homework question.

I use this code but it kept saying `linalg error due to 1 dimension, it require 2.`

```
import numpy as np
A = np.array([[5,10,5],[-5,-2,-3],[5,-10,-15,-3]])
print(A)
c = np.array([0,0,0])
y = np.linalg.solve(A,c)
print(y)
```