# 多分支报错try: print("hello") # print(x) print("======>")except KeyError as k: raise KeyError() # print(k)except NameError as n: print(n)else: print("try code 没有异常,就执行我")finally: print("无论有无异常都执行,一般执行清理操作")# 万能异常try: print(x)except Exception as e: print(e)else: print("try code 没有异常,就执行我")finally: print("无论有无异常都执行,一般执行清理操作")