Program Console Vignaankosh.com
Execution Panel
Console is empty.
Traverse set using for loop is an interactive PYTHON dry run visualizer from the Sets 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.
# Traverse set using for loop
colors = {"Red", "Green", "Blue", "Yellow", "Purple"}
print("Set:", colors)
# Basic traversal
print("\nBasic for loop:")
for color in colors:
print(f" {color}")
# Using enumerate (shows index - but order arbitrary)
print("\nUsing enumerate:")
for idx, color in enumerate(colors):
print(f" {idx}: {color}")
# Traverse with condition
print("\nTraverse with condition:")
for color in colors:
if len(color) > 4:
print(f" {color} (length {len(color)})")