Exploring What's Inside a Module (dir() function) Dry Run in PYTHON

Exploring What's Inside a Module (dir() function) is an interactive PYTHON dry run visualizer from the Modules programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Exploring What's Inside a Module (dir() function) Program Code

import math
import mymath

# Select a few useful public names from math
math_items = [name for name in dir(math) if name in ("pi", "pow", "sqrt")]
print("Selected math items:", math_items)

# See only our custom items (ignore hidden ones)
our_items = [item for item in dir(mymath) if not item.startswith('_')]
print("Our mymath module has:", our_items)

View the complete Modules programs page.

Program Console Exploring What's Inside a Module (dir() function) Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.