Python Programming - Debugging
Exercise : Debugging - General Questions
- Debugging - General Questions
11.
What does the Python
locals()
function provide during debugging?
Answer: Option
Explanation:
The
locals()
function in Python provides a dictionary of all local variables in the current scope during debugging.
12.
In Python, what does the
breakpoint()
function do?
Answer: Option
Explanation:
The
breakpoint()
function is used to insert a breakpoint in the code for debugging, allowing interactive debugging at that point.
13.
What does the Python
globals()
function provide during debugging?
Answer: Option
Explanation:
The
globals()
function in Python provides a dictionary of all global variables during debugging.
14.
What is the purpose of the
pdb.set_trace()
function in the pdb
module?
Answer: Option
Explanation:
The
pdb.set_trace()
function in the pdb
module is used to insert a breakpoint in the code for debugging, allowing interactive debugging at that point.
15.
What does the Python
traceback.print_exc()
function do?
Answer: Option
Explanation:
The
traceback.print_exc()
function in Python is used to print the exception traceback to the console during debugging.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers