while True:
try:
num1 = int(input("Enter the first number:"))
num2 = int(input("Enter the second number:"))
print(num1/num2)
break
except Exception as err:
print("Something went wrong!")
print(err)
while True:
try:
num1 = int(input("Enter the first number:"))
num2 = int(input("Enter the second number:"))
print(num1/num2)
break
except Exception as err:
print("Something went wrong!")
print(err)
本文标题:2019-01-25 异常捕捉
本文链接:https://www.haomeiwen.com/subject/mzcvjqtx.html
网友评论