raise exception-type : Raise : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Raise »

 

raise exception-type


import sys

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

exc_thrower(0)



Leave a Comment / Note


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


PYTHON TUTORIALS

 Navioo Statement
» Raise