Python Programming - Debugging
Exercise : Debugging - General Questions
- Debugging - General Questions
1.
What is the purpose of the Python
pdb
module?
Answer: Option
Explanation:
The
pdb
module in Python is used for debugging and interactively exploring code, providing a powerful debugger with features like breakpoints and code stepping.
2.
Which Python module provides a graphical user interface (GUI) for interactive debugging?
Answer: Option
Explanation:
The
pdb
module in Python provides a command-line interface for debugging. There is no built-in graphical debugger, but external tools like pdb++
can provide a graphical user interface.
3.
In Python, what does the
sys.settrace()
function do?
Answer: Option
Explanation:
The
sys.settrace()
function in Python sets a trace function for all thread events, allowing you to monitor and debug the execution flow.
4.
What does the Python
step
command do in a debugger like pdb
?
Answer: Option
Explanation:
In a debugger like
pdb
, the step
command is used to step into a function or method call, allowing you to debug the code inside that function.
5.
Which Python module allows you to set breakpoints and inspect variables interactively during program execution?
Answer: Option
Explanation:
The
pdb
module in Python provides a built-in debugger that allows setting breakpoints and interactively inspecting variables during program execution.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers