Mega Code Archive

 
Categories / Python Tutorial / Statement
 

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)