debuggingtestingand profiling commands are given to pdb by entering their name and pressing enter at the (pdbprompt if we just press enter on its own the last command is repeated so here we typed (which means stepi execute the statement shown)and then repeated this (simply by pressing enter)to step through the statements in the calculate_median(function once we reached the return statement we printed out the values that interested us using the (printcommand and finally we continued to the end using the (continuecommand this tiny example should give flavor of pdbbut of course the module has lot more functionality than we have shown here it is much easier to use pdb on an instrumented program as we have done here than on an uninstrumented one but since this requires us to add an import and call to pdb set_trace()it would seem that using pdb is just as intrusive as using print(statementsalthough it does provide useful facilities such as breakpoints the other standard debugger is idleand just like pdbit supports single steppingbreakpointsand the examination of variables idle' debugger window is shown in figure and its code editing window with breakpoints and the current line highlighted is shown in figure figure idle' debugger window showing the call stack and the current local variables one great advantage idle has over pdb is that there is no need to instrument our code--idle is smart enough to debug our code as it standsso it isn' intrusive at all unfortunatelyat the time of this writingidle is rather weak when it comes to running programs that require command-line arguments the only way to do this appears to be to run idle from console with the required arguments