Python计算二阶行列式的值


本文将使用Python语言编写程序计算二阶行列式的值;

Python程序实现


D= [[] for i in range(2)]

for i in range(2):  
    D[i] = [int(v) for v in input().split()]

value = D[0][0]*D[1][1]-D[0][1]*D[1][0]

print(value)

运行效果

1 2
3 4
-2

如需转载,请注明出处;本文地址:https://www.perfcode.com/p/the-two-order-determinant-in-python.html