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 module to use the built-in functions for calculation
Prepare the lists from each linear equations and assign in np.array()
Using the np.linalg.solve(), we can find the solutions.
End the program
#Program to find the solution for the given linear equations.
#Developed by:JEECIKASRINA M
#RegisterNumber:23013947
import numpy as np
a=np.array([[5,-3,-10],[2,2,-3],[-3,-1,5]])
b=np.array([-9,4,-1])
result=np.linalg.solve(a,b)
print(result)
Thus the solutions for the linear equations are successfully solved using python program