M11) Stepping through a call in VS Code

A delivery charge looks wrong, so you pause the program in the VS Code debugger. In Listing 1, Breakpoint A is on the call to delivery_fee, and Breakpoint B is on print(total). Both breakpoints are enabled. Execution is paused at Breakpoint A, before that line runs, so fee does not have a value yet.

Listing 1: Program paused before a delivery charge is calculated.
def delivery_fee(distance_km: int) -> int:
    if distance_km <= 5:
        return 2
    return 5


def order_total(subtotal: int, distance_km: int) -> int:
    fee = delivery_fee(distance_km)  # Breakpoint A
    return subtotal + fee


def main() -> None:
    total = order_total(20, 6)
    print(total)  # Breakpoint B


main()

You want to inspect distance_km inside delivery_fee, return to order_total, finish the assignment to fee, inspect it on the following line, and then run to Breakpoint B. Which sequence of VS Code debugger controls does that?

  1. Step Into, Step Out, Step Over, Continue
  2. Step Into, Step Out, Continue
  3. Step Over, Step Out, Step Over, Continue
  4. Step Into, Continue, Step Over, Continue