Trace a breakpoint inside a called function

A student debugs the program below. The only breakpoint is on the line bonus = n // 10 inside score. They start the debugger and press Resume (Continue) after every pause until the program finishes.


Python
def score(n):
    bonus = n // 10
    return n + bonus

results = []
for n in [12, 35, 8, 41]:
    if n > 10:
        results.append(score(n))
print(results)


Give each answer as a whole number:

  • how many times the program pauses on the breakpoint line;
  • the value of n at the second pause;
  • how many items the list results holds at the second pause;
  • the last number in the list that print displays.
Your answers

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 Development Environments Questions: