Python Programming - Debugging
Exercise : Debugging - General Questions
- Debugging - General Questions
16.
What does the Python
pdb.run() function do?
Answer: Option
Explanation:
The
pdb.run() function in Python runs the Python script with an embedded debugger, allowing for interactive debugging.
17.
What does the Python
inspect module provide in terms of debugging?
Answer: Option
Explanation:
The
inspect module in Python provides information about the call stack and code introspection, aiding in debugging.
18.
What does the Python
set_trace() function do in the pdb module?
Answer: Option
Explanation:
The
set_trace() function in the pdb module is used to insert a breakpoint in the code for debugging, allowing interactive debugging at that point.
19.
What is the purpose of the Python
traceback.format_exc() function?
Answer: Option
Explanation:
The
traceback.format_exc() function in Python formats the exception traceback as a string during debugging.
20.
What is the purpose of the Python
pdb.post_mortem() function?
Answer: Option
Explanation:
The
pdb.post_mortem() function is used to create a post-mortem debugger session after an unhandled exception, allowing examination of the program state at the point of the exception.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers