Solved

B When There Are Except Handlers, Program Control Transfers to the First

Question 21

Multiple Choice

b. When there are except handlers, program control transfers to the first one that matches the type of the raised exception. If there are no except handlers that match the raised exception, a process called xe "stack:unwinding"stack unwinding occurs.
c. When an except clause successfully handles an exception, program execution resumes with the finally clause (if there is one) , then with the next statement after the try statement.
d. After an exception is handled, program control returns to the xe "raise point"raise point.
Answer: d. Actually, after an exception is handled, program control does not return to the xe "raise point"raise point-rather, control resumes after the try statement.
9.8.3 xe "multiple-exception catching[multiple exception catching]"xe "except clause:catching multiple exceptions"xe "catching multiple exceptions in one except clause"Catching Multiple Exceptions in One except Clause
-Which of the following statements is false?


A) A try clause is often followed by several except clauses to handle various types of exceptions.
B) When no exceptions occur in the try suite, program execution resumes with the xe "else clause:of a try statement"else clause (if there is one) ; otherwise, program execution resumes with the next statement after the try statement.
C) If several except suites are identical, you can catch those exception types by specifying them as a tuple in a single except handler, as in: except [type1, type2, …] as variable_name
D) You can use the variable name in the optional as-clause to reference the exception object in the except suite.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents