| 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"
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.