Ask Your Question

Revision history [back]

Something like this:

def temp(x):
    try:
        return 3/x
    except ZeroDivisionError:
        return False

Then

sage: temp(2)
3/2
sage: temp(0)
False