Program Console Vignaankosh.com
Execution Panel
Console is empty.
Dictionary of cubes (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 cubes (number: cube)
n = 8
cubes = {x: x**3 for x in range(1, n+1)}
print(f"Cubes from 1 to {n}:")
for num, cube in cubes.items():
print(f" {num}³ = {cube}")
# For odd numbers only
odd_cubes = {x: x**3 for x in range(1, n+1) if x % 2 != 0}
print(f"\nOdd numbers cubes: {odd_cubes}")
# Using loop
cubes_loop = {}
for i in range(1, 9):
cubes_loop[i] = i**3
print(f"\nLoop result: {cubes_loop}")