Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find duplicate elements using sets 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.
# Find duplicate elements using sets
data = [1, 2, 3, 2, 4, 5, 3, 6, 7, 1, 8, 2]
print("List:", data)
seen = set()
duplicates = set()
for item in data:
if item in seen:
duplicates.add(item)
else:
seen.add(item)
print(f"Duplicate elements: {duplicates}")
print(f"Unique elements: {seen}")
# Find elements that appear exactly once
unique_once = seen - duplicates
print(f"Elements appearing once: {unique_once}")