An exception occurs when a program encounters an event which it cannot cope with. In such a situation, if the exception is not properly handled the program would likely face an unexpected termination.
There are certain areas in a program that we can say the probability of an exception been raised is high. For example when opening a file, writing to a file, working on high memory consumptive tasks.
Exception causes...
01. When trying to open a file to read that doesn't exist
02. Trying to write to file without sufficient privileges
03. A division by zero etc..
An exception is a Python object that refers to the type of exception encountered.
What could be done?
Suspicious lines of code could be put within a 'try' block and appropriately the exceptions excepted and resolved.