Try Except

Question

Demonstrate try except statement in python.

Solution

try:
    num = 1/0
except ZeroDivisionError:
    raise
    num = 1/1
print num
Run this
Comments by Disqus