Output:
#Solve the system of equations x0 + 2 * x1 = 1 and 3 * x0 + 5 * x1 = 2: print("We have a system of equations: x0 + 2 * x1 = 1 and 3*x0 + 5*x1 = 2 ") import numpy as np a = np.array([[1, 2], [3, 5]]) b = np.array([1, 2]) x = np.linalg.solve(a, b) print("Solution of system of equations is: ") print(x) #Check that the solution is correct: print("Solution of system of equation is ok? ") np.allclose(np.dot(a, x), b)
Run
You can execute any Python code. Just enter something in the box above and click the button.