5x 2y 9z 2x-5y x-y n5x 2y 9z n2x-5y nx-y from sympy import Matrix Matr

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
>>> """
5x+2y+9z=8
2x-5y+z=0
x-y+z=3
"""
'\n5x+2y+9z=8\n2x-5y+z=0\nx-y+z=3\n'
>>> from sympy import Matrix
>>> A = Matrix([[5,2,9], [2,-5,1],[1,-1,1]])
>>> B = Matrix([[8],[0],[3]])
>>> A.inv()*B
[109/5]
[ 31/5]
[-63/5]
>>>