try_continue.py 252 B

12345678910111213
  1. # test continue within exception handler
  2. def f():
  3. lst = [1, 2, 3]
  4. for x in lst:
  5. print('a', x)
  6. try:
  7. if x == 2:
  8. raise Exception
  9. except Exception:
  10. continue
  11. print('b', x)
  12. f()