We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Linear Algebra
- Discussions
Linear Algebra
Linear Algebra
Sort by
recency
|
295 Discussions
|
Please Login in order to post a comment
# Enter your code here. Read input from STDIN. Print output to STDOUT
import numpy as np n = int(input()) matrix = [list(map(float, input().split())) for _ in range(n)]
np_matrix = np.array(matrix)
det = np.linalg.det(np_matrix)
print(round(det,2))
For Python3 Platform
For Python 3
import numpy as np
n = int(input()) a = np.array([list(map(float, input().split(" "))) for i in range(n)]) print(round(np.linalg.det(a),2))
For Python3