Mega Code Archive

 
Categories / Python / Exception
 

Raising Exceptions

# The raise statement: force a specified exception to occur. raise NameError, 'HiThere' # The above could be written as  raise NameError('HiThere')