Python try...except


try:
	print("业务逻辑")
except Error as e:
	print("出现异常会执行此处")
else:
	print("不出现异常会执行此处")
finally:
	print("是否出现异常都会执行此处")

你可能感兴趣的:(Python)