the step over button thousands of times before the program terminated if you were interested in the value of heads at the halfway point of the program' executionwhen of , coin flips have been completedyou could instead just set breakpoint on the line print('halfway done!'to set breakpointclick the line number in the file editor to cause red dot to appearmarking the breakpoint like in figure - figure - setting breakpoint causes red dot (circledto appear next to the line number you don' want to set breakpoint on the if statement linesince the if statement is executed on every single iteration through the loop when you set the breakpoint on the code in the if statementthe debugger breaks only when the execution enters the if clause the line with the breakpoint will have red dot next to it when you run the program under the debuggerit will start in paused state at the first lineas usual but if you click continuethe program will run at full speed until it reaches the line with the breakpoint set on it you can then click continuestep overstep inor step out to continue as normal if you want to remove breakpointclick the line number again the red dot will go awayand the debugger will not break on that line in the future summary assertionsexceptionsloggingand the debugger are all valuable tools to find and prevent bugs in your program assertions with the python assert statement are good way to implement "sanity checksthat give you an early warning when necessary condition doesn' hold true assertions are only for errors that the program shouldn' try to recover from and should fail fast otherwiseyou should raise an exception