Exceptions occur when certain exceptional situations occur in your program. For example, what if you are going to read a file and the file does not exist? Or what if you accidentally deleted it when the program was running? Such situations are handled usingexceptions.
Similarly, what if your program had some invalid statements? This is handled by Python which raises its hands and tells you there is an error.