Computer exceptions

Computer code exceptions happen when an invalid operation is performed. For example division by 0 is done, or opening of non-existing file is performed. Typically these type of errors will cause an application to crash and exit the execution of the code that follows the line where that exception occurred.

To handle exceptions it is possible to wrap the code, where an exception is expected to occur in exception handling block. In Python programming language it is try and except block. If exception occurs in try block than there are chances that it will be handled by the except block. I am saying that there are chances, because exceptions can be of different types, and it depends what type of exceptions are handled by the application. It is also possible to specify default exception handling. Default exception handling will handle all error types.

YouTube video

Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator