Which of the following statements is true?
A. The standard exceptions are automatically imported into Python programs
B. All raised standard exceptions must be handled in Python
C. When there is a deviation from the rules of a programming language, a semantic error is thrown
D. If any exception is thrown in try block, else block is executed
Answer: Option A
What is the purpose of exception handling in Python?
A. To handle runtime errors and prevent the program from crashing
B. To print error messages
C. To ignore errors
D. To enhance program speed
When is the finally block executed?
A. when there is no exception
B. when there is an exception
C. only if some condition that has been specified is satisfied
D. always
What is an exception in Python?
A. An error that occurs during the execution of a program
B. A built-in function
C. A keyword
D. A specific data type
How many except statements can a try-except block have?
A. zero
B. one
C. more than one
D. more than zero

Join The Discussion