Program Console Vignaankosh.com
Execution Panel
Console is empty.
Create multiplication table dictionary 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 multiplication table dictionary
num = 7
limit = 10
# Method 1: Using comprehension
table = {i: num * i for i in range(1, limit + 1)}
print(f"Multiplication table of {num}:")
for multiplier, result in table.items():
print(f" {num} × {multiplier:2} = {result:3}")
# Method 2: Nested dictionary (tables for multiple numbers)
tables = {n: {i: n * i for i in range(1, 6)} for n in range(2, 6)}
print("\nNested dictionary (tables 2-5):")
for n, mult_table in tables.items():
print(f" Table of {n}: {mult_table}")
# Method 3: 2D table as dictionary
print("\n2D Multiplication table (1-5):")
matrix = {(i, j): i * j for i in range(1, 6) for j in range(1, 6)}
for i in range(1, 6):
row = [matrix[(i, j)] for j in range(1, 6)]
print(f" {row}")