代码示例:(标识:python_ref_keyword_else_2)
python_ref_keyword_else_2.py
x = 5

try:
  x > 10
except:
  print("Something went wrong")
else:
  print("The 'Try' code was executed without raising any errors!")
运行结果: