do_try.py 213 B

123456789101112
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. try:
  4. print('try...')
  5. r = 10 / 0
  6. print('result:', r)
  7. except ZeroDivisionError as e:
  8. print('except:', e)
  9. finally:
  10. print('finally...')
  11. print('END')