πAn unwanted and unexpected event
that disturbs normal flow of program
is called exception.
Ex:
ZeroDivisionError
TypeError
ValueError
FileNotFoundError
EOFError
SleepingError
TyrePuncturedError
πIt is highly recommended to handle
exceptions.The main objective of
exception handling is Graceful
Termination of the program.
πException handling does not mean
repairing exception. We have to define
alternative way to continue rest of the
program normally.
Ex:
πFor example our programming
requirement is reading data from remote
file locating at London. At runtime if
London file is not available then the
program should not be terminated
abnormally.
We have to provide local file to continue
rest of the program normally.
This way of defining alternative is nothing
but exception handling.
try:
Copy code
read data from remote file locating at london
exception FileNotFoundError:
use local file and continue rest of the
program normally
Questions
What is an Exception?
What is the purpose of Exception Handling?
What is the meaning of Exception Handling?

No comments:
Post a Comment
Thank you Very Much.For Given Comment