1 | initial version |
Well, using Python exceptions, you may define a division function like this:
def div(x,y):
try:
return x/y
except ZeroDivisionError:
return 1
It yields
sage: div(2,3)
2/3
sage: div(2,0)
1
sage: div(x,x-x)
1
2 | No.2 Revision |
Well, using Python exceptions, you may define a division function like this:
def div(x,y):
div(x, y):
try:
return x/y
except ZeroDivisionError:
return 1
It yields
sage: div(2,3)
2/3
sage: div(2,0)
1
sage: div(x,x-x)
1
3 | No.3 Revision |
Well, using Python exceptions, you may define a division function like this:
def div(x, y):
try:
return x/y
except ZeroDivisionError:
return 1
It yields
sage: div(2,3)
2/3
sage: div(2,0)
1
sage: div(x,x-x)
1