import random
while True:
def exp_exception(x,y):
try:
a=int(x/y)
print(“a=”, a)
return a
except Exception:
print(“程序出现异常,异常信息:被除数为0”)
cs_input=int(input(“请输入被除数”))
exp_exception(random.randint(10000),cs_input)
除数为0,程序异常的处理
最新推荐文章于 2023-11-23 18:37:00 发布