主页
Python
Python except 关键词
demo_ref_keyword_except4
运行 ❯
×
更改方向
保存代码
更改主题
# (x > 10) will not raise any errors: x = 1 try: x > 10 except NameError: print("You have a variable that is not defined.") except TypeError: print("You are comparing values of different type") else: print("The 'Try' code was executed without raising any errors!")
The 'Try' code was executed without raising any errors!