>A Byte of Python

Chapter 13. Exceptions

Exceptions occur when certain exceptional situations occur in your program. For example, what if you are reading a file and you accidentally deleted it in another window or some other error occurred? Such situations are handled using exceptions.

What if your program had some invalid statements? This is handled by Python which raises its hands and tells you there is an error.