This is an automatically generated file.
Part 1
Part 2
def test_div_by_zero():
"""Try 1/0 and 0/0."""
my_zero = ZERO
print("")
print("What message and/or values does Division by ZERO produce?")
print("This can interupt your program. You can ", end="")
print("skip this part if you wish.")
s = alt_input("Do you wish to compute 1 / 0?\n")
if s.startswith("N") or s.startswith("n"):
print("O.K. skipping")
else:
print("\tTrying to compute 1 / 0 produces ...")
try:
print(" \t{:0.7e} .".format(ONE / my_zero))
except ZeroDivisionError:
print("\tComputing 1 / 0 triggered an exception.")
s = alt_input("\nDo you wish to compute 0 / 0?\n")
if s.startswith("N") or s.startswith("n"):
print("O.K. skipping")
else:
print("\tTrying to compute 0 / 0 produces ...")
try:
print("\t{:0.7e} .", ZERO / my_zero)
except ZeroDivisionError:
print("\tComputing 0 / 0 triggered an exception.")
return
Part 3