Chapter 13 Exceptional Handling
Chapter 13 Exceptional Handling
EXCEPTIONAL HANDLING
XI
Computer Science (083)
Board : CBSE
Unit 2:
Computational Thinking and Programming
Courtesy CBSE
Unit II
Computational Thinking and Programming
2. Semantic Errors
3. Type of Errors
5. Logical Errors.
1. Syntax Errors
) Missing
2. Semantic Errors
What is an exception?
For Example
Handling Exceptions
Handling Exceptions
For Example
Handling Exceptions
IOError
If the file cannot be opened.
ImportError
If python cannot find the module.
ValueError
Raised when a built-in operation or function
receives an argument that has the right type but
an inappropriate value.
Some common exceptions
KeyboardInterrupt
Raised when the user hits the interrupt key
(normally Control-C or Delete).
EOFError
Raised when one of the built-in functions (input()
or raw_input()) hits an end-of-file condition (EOF)
without reading any data
CLASS TEST
CLASS TEST