To write a python program to find a solution to a system of linear equations.
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
Import the numpy package
Get the input matrix
Find the system of linear equation
Print the output
#Program to find the solution for the given linear equations.
#Developed by:vaishnavi
#RegisterNumber:22009040
import numpy as np
A = np.array([[1,-3],[3,1]])
B = np.array([0,10])
sol = np.linalg.solve(A,B)
print(sol)
Thus the solutions for the linear equations are successfully solved using python program