
Python InstitutePCPP1 - Certified Professional Python Programmer 1
Domain 1Objective 9
PCPP-32-101 1.9 Advanced Techniques for Creating and Serving Exceptions PCPP-32-1 Practice Questions (Page 4)
Part of the Advanced Object-Oriented Programming domain, which accounts for 35% of the PCPP-32-1 exam. Python Institute does not publish an official question count, but from its 65-minute exam (~25–45 total, ~9–16 in this domain), expect 1–1 from this objective — we provide 18 practice questions to prepare you well beyond it. (estimate)
18questions here
4free pages
7concepts
35%of the exam
Questions 16–18
- 16
A senior developer is reviewing a colleague's code that wraps a database error. The code is: try: db.query() except DBError as e: raise APIError("Query failed") from e The reviewer notes that the traceback shows both exceptions. The colleague asks: 'What is the difference between __context__ and __cause__ in this traceback, and what would change if I removed the 'from e' clause?' Which answer is correct?
Select an answer first - 17
What can you do with the `__traceback__` attribute of an exception?
Select an answer first - 18
A monitoring tool catches an exception and needs to extract the filename and line number of the frame where the exception was originally raised, not where it was caught. The exception object is available as 'exc'. Which code correctly retrieves this information?
Select an answer first
Finished these 3 questions?
Review the revealed explanations, or continue through the curriculum.
No more pagesBack to PCPP-32-1
Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by Python Institute. “PCPP-32-1” is a trademark of its owner, used for identification only.