代码示例:(标识:python_try_except_3)
python_try_except_3.py
#The try block does not raise any errors, so the else block is executed:

try:
  print("Hello")
except:
  print("Something went wrong")
else:
  print("Nothing went wrong")
运行结果: