Program Console Vignaankosh.com
Execution Panel
Console is empty.
Dictionary of squares (1 to n) is an interactive PYTHON dry run visualizer from the Dict 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.
# Create dictionary of squares (number: square)
n = 10
squares = {x: x**2 for x in range(1, n+1)}
print(f"Squares from 1 to {n}:")
for num, sq in squares.items():
print(f" {num}² = {sq}")
# Using loop
squares_loop = {}
for i in range(1, 11):
squares_loop[i] = i**2
print("\nUsing loop:", squares_loop)
# Only even numbers
even_squares = {x: x**2 for x in range(2, 11, 2)}
print(f"\nEven numbers squares: {even_squares}")