Certified Professional in Python Programming (PCPP-32-101) — Question 35
What is a __traceback__? (Choose two.)
Answer options
- A. An attribute owned by every exception object
- B. A special method delivered by the traceback module to retrieve a full list of strings describing the traceback
- C. An attribute that is added to every object when the traceback module is imported
- D. An attribute that holds interesting information that is particularly useful when the programmer wants to store exception details in other objects
Correct answer: A, D
Explanation
The correct answers, A and D, describe the characteristics of a traceback in Python. Option A is accurate because every exception object has a traceback attribute that provides context about the error. Option D is also correct as it indicates that the traceback contains useful information for storing exception details. Options B and C are incorrect because they misrepresent the function and behavior of the traceback module and its attributes.