#python #python3 #pythoncourse #exceptions
@kingoftechniques6864
An exception is a Python object that represents an error. When a Python script raises an exception, it must either handle the exception immediately otherwise it terminates and quits.
The code that follows the except statement is the program’s response to any exceptions in the preceding try clause. As you saw earlier, when syntactically correct code runs into an error, Python will throw an exception error.
Errors are the problems in a program due to which the program will stop the execution. On the other hand, exceptions are raised when the some internal events occur which changes the normal flow of the program. Two types of Error occurs in python. Syntax errors; Logical errors (Exceptions) Syntax errors