Count conditional breakpoint pauses

A museum counts visitors arriving in six groups using the Python code below. A conditional breakpoint pauses execution only when its condition is true.


Python
total = 0
for group in [12, 18, 9, 21, 15, 24]:
    total += group


The breakpoint is attached to total += group, with condition total >= 30. The debugger checks the condition immediately before executing that line on every iteration. You continue execution after every pause without changing any values. How many breakpoint pauses occur during this run? Answer as an exact integer number of pauses, to zero decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Debugging Strategies Questions: