examples/advanced/try.py
def divide(x, y):
    try:
        print(x/y)
    except ZeroDivisionError:
        pass 
    except (IOError, MemoryError) as e:
        pass
    else:
        print("This will run if there was no exception at all")
    finally:
        print("Always executes. {}/{} ended.".format(x, y))


divide(6, 2)
divide(6, 0)
divide(6, "a")
print("ater all")

examples/advanced/try.out
3
This will run if there was no exception at all
Always executes. 6/2 ended.
Always executes. 6/0 ended.
Always executes. 6/a ended.
Traceback (most recent call last):
  File "try.py", line 17, in <module>
    divide(6, "a")
  File "try.py", line 4, in divide
    print(x/y)
TypeError: unsupported operand type(s) for /: 'int' and 'str'