examples/other/exceptions.py
#!/usr/bin/env python
from __future__ import print_function

a = 1
b = 0

try:
    a / b
except ZeroDivisionError:
    print('ZeroDivisionError exception received')

try:
    a / b
except ZeroDivisionError as e:
    print('Antother ZeroDivisionError exception received')
    print(e)   # integer division or modulo by zero


try:
    a + "hello"
except (ZeroDivisionError, TypeError) as e:
    print(e)  # unsupported operand type(s) for +: 'int' and 'str'

try:
    a + "hello"
except (ZeroDivisionError, TypeError) as e:
    pass   # just disregard these exceptions