liveBook · Manning

Step Into

As explained in Learn AI-Assisted Python Programming, Second Edition

Step Into is a debugger command that advances execution and enters a function called by the current code when possible.

Step Into advances execution one line at a time and enters functions called by the current code. In VS Code, press F11 to follow your own functions during debugging. section 8.2.2

Use Step Into to inspect what happens inside a function call:

  • Pause at a breakpoint, select Step Into, and continue through the called function line by line. section 8.2.2
  • Expect the debugger to enter functions you wrote, while usually running standard-library calls such as word.lower() without opening them. section 8.2.2
  • Choose Step Over instead when you want to remain in the current function and execute the called function to completion. section 8.2.2
Listing 8.4 Incorrect count_words function for debugging
def count_words(words): 
    count = 0 
    for word in words: 
        if "dan" in word.lower(): 
            count += 1 
    return count 

words = ["Dan", "danger", "Leo"]     #1
print(count_words(words))            #1

Use the incorrect count_words example to follow how execution moves from the main code into count_words during debugging. section 8.2.2

How Learn AI-Assisted Python Programming, Second Edition covers it

How deep it goes
Defines the command, shortcut, and library-call default, but does not detail debugger internals.
Examples
Demonstrates stepping through the count_words function and contrasts entering calls with running them to completion.
What it assumes
Assumes a running VS Code debugging session with a breakpoint and basic familiarity with function calls.
What you can do after
Diagnose execution behavior by tracing user-written functions line by line in the debugger.
How it connects
Connects Step Into with breakpoints, Step Over, Step Out, Continue, Restart, and Stop.

Also explained in

Compare how 4 books explain Step Into →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn AI-Assisted Python Programming, Second Edition. The section links point to the parts of the book it draws on.