added detcheck feature
This commit is contained in:
parent
4210f632d7
commit
f1c93f2302
@ -22,6 +22,12 @@ def multcheck(a, b, rowcol, intmax) :
|
|||||||
# return bool based on if input equals the two matrices multiplied together
|
# return bool based on if input equals the two matrices multiplied together
|
||||||
return (sp.Matrix(inmat(rowcol)) == a*b)
|
return (sp.Matrix(inmat(rowcol)) == a*b)
|
||||||
|
|
||||||
|
# detcheck function to check if the determinant of the matrix is correct
|
||||||
|
def detcheck(a, b, rowcol, intmax):
|
||||||
|
det = sp.det(a)
|
||||||
|
# return bool based on if input equals determinant
|
||||||
|
return (det == sp.nsimplify(input("What is the determinant of this matrix?: ")))
|
||||||
|
|
||||||
# practice function
|
# practice function
|
||||||
def practice(t) :
|
def practice(t) :
|
||||||
count = 0
|
count = 0
|
||||||
@ -32,6 +38,8 @@ def practice(t) :
|
|||||||
# choose the function of the program that you want
|
# choose the function of the program that you want
|
||||||
if t == "mult" :
|
if t == "mult" :
|
||||||
f = multcheck
|
f = multcheck
|
||||||
|
elif t == "det" :
|
||||||
|
f = detcheck
|
||||||
else :
|
else :
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user