Certified Entry-Level Python Programmer (PCEP-30-02) — Question 35
The unnamed except block ...
Answer options
- A. must be the first one.
- B. cannot be used if any named block has been used.
- C. must be the last one.
- D. can be placed anywhere.
Correct answer: C
Explanation
The unnamed except block must be the last one because it serves as a catch-all for any exceptions not handled by named blocks. Options A, B, and D are incorrect since the unnamed block cannot be the first, cannot be used with named blocks, and cannot be placed anywhere except at the end.