Program Console Vignaankosh.com
Execution Panel
Console is empty.
Access tuple using negative indexing 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.
# Negative indexing in tuples
numbers = (12, 24, 36, 48, 60, 72)
print("Tuple:", numbers)
# Negative indices count from end
print(f"Index -1 (last): {numbers[-1]}")
print(f"Index -2 (second last): {numbers[-2]}")
print(f"Index -3 (third last): {numbers[-3]}")
print(f"Index -6 (first): {numbers[-6]}")
# Slice with negative indices
print(f"\nLast 3 elements: {numbers[-3:]}")
print(f"All except last 2: {numbers[:-2]}")
print(f"Middle using negative: {numbers[-4:-1]}")