linalg solve output in one line in python

To get the output of linalg.solve in one line in Python, you can simply enclose the function call within the print function. Here's an example:

main.py
import numpy as np

A = np.array([[2, 1], [1, 1]])
b = np.array([1, 2])

print(np.linalg.solve(A, b))
102 chars
7 lines

This will output the result of the linalg.solve function call on a single line.

related categories

gistlibby LogSnag