ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 30 Jan 2022 20:06:57 +0100Error Handlinghttps://ask.sagemath.org/question/60887/error-handling/I am very new to Sage, so apologies if the answer to this question is obvious.
I have a program, and at the final calculation, for T and E matrices calculated earlier, it needs to either calculate a matrix A such that `T=AE`, or, if this returns an error message, calculate a matrix A such that `p*T=AE`, where p is also calculated earlier.
In mock code, what I mean is:
Calculate E.solve_left(T)
If that returns an error:
A=E.solve_left(p*T)
else:
A=E.solve_left(T)
return A
But I don't know how to do that in real code.RuneSun, 30 Jan 2022 20:06:57 +0100https://ask.sagemath.org/question/60887/