Program Console Vignaankosh.com
Execution Panel
Console is empty.
Negative indexing examples is an interactive PYTHON dry run visualizer from the Lists 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 examples
numbers = [10, 20, 30, 40, 50, 60]
print("List:", 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]}")
# Slicing with negative indices
print(f"Last 3 elements: {numbers[-3:]}")
print(f"All except last: {numbers[:-1]}")