Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find unique elements in list 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.
# Find unique elements (elements that appear exactly once)
nums = [1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 8]
print("List:", nums)
# Method 1: Using dictionary
freq = {}
for num in nums:
freq[num] = freq.get(num, 0) + 1
unique = [num for num, count in freq.items() if count == 1]
print(f"Unique elements (appear once): {unique}")
# Method 2: Using Counter
from collections import Counter
counter = Counter(nums)
unique2 = [num for num, count in counter.items() if count == 1]
print(f"Using Counter: {unique2}")