Program Console Vignaankosh.com
Execution Panel
Console is empty.
Access nested tuple elements (deep access) is an interactive PYTHON dry run visualizer from the Tuples 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.
# Access elements in deeply nested tuples
deep_nested = (10, (25, 35, (45, 55, (65, 75))), 90)
print("Deep nested tuple:", deep_nested)
# Access at different levels
print(f"Level 0: {deep_nested[0]}")
print(f"Level 1: {deep_nested[1]}")
print(f"Level 2 (inside inner): {deep_nested[1][2]}")
print(f"Level 3: {deep_nested[1][2][1]}")
print(f"Level 4: {deep_nested[1][2][2][0]}")
# Practical example: Matrix
matrix = ((11, 12, 13), (21, 22, 23), (31, 32, 33))
print(f"\nMatrix: {matrix}")
print(f"Center element matrix[1][1]: {matrix[1][1]}") # 5
print(f"First row: {matrix[0]}")
print(f"Last column of each row: {matrix[0][2]}, {matrix[1][2]}, {matrix[2][2]}")