Program Console Vignaankosh.com
Execution Panel
Console is empty.
Remove duplicate elements from 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.
# Remove duplicates from list
nums = [1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7]
print("Original:", nums)
# Method 1: Using set() (order not preserved)
unique_set = list(set(nums))
print("Using set():", unique_set)
# Method 2: Using dict.fromkeys() (preserves order Python 3.7+)
unique_dict = list(dict.fromkeys(nums))
print("Using dict.fromkeys():", unique_dict)
# Method 3: Manual loop (preserves order)
unique_manual = []
for num in nums:
if num not in unique_manual:
unique_manual.append(num)
print("Manual loop:", unique_manual)