fork download
  1. try:
  2. list = [1,2,3,4,5]
  3. x = list[5]
  4. print("Success")
  5. except IndexError:
  6. print("Index out of bound")
  7. else:
  8. print("All is well")
  9. finally:
  10. print("I am saved")
Success #stdin #stdout 0.02s 7076KB
stdin
Standard input is empty
stdout
Index out of bound
I am saved