1 | initial version |
Python (therefore Sage) offers a try/except system to handle exceptions, see this page for more details.
In your case, you can try something like:
try:
n = exp.n()
except TypeError:
print "sorry, no"
2 | No.2 Revision |
Python (therefore Sage) offers a try/except system to handle exceptions, see this page for more details.
In your case, you can try write something like:
try:
n = exp.n()
except TypeError:
print "sorry, no"