raise ZeroDivisionError : Raise : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Raise »

 

raise ZeroDivisionError


import sys

def exc_thrower(x:
    z = 0
    try :
        z = 100 / x
    except :
        print "Error encountered in exc_thrower: "+repr(sys.exc_type)
        raise

exc_thrower(0)
exc_thrower("Hello")



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Raise