Program Console Vignaankosh.com
Execution Panel
Console is empty.
Merge two lists 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.
# Merge two lists
list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
# Method 1: + operator
merged = list1 + list2
print("Using + operator:", merged)
# Method 2: extend() method
list1_copy = [1, 2, 3, 4]
list1_copy.extend(list2)
print("Using extend():", list1_copy)
# Method 3: Using * unpacking (Python 3.5+)
merged_unpack = [*list1, *list2]
print("Using * unpacking:", merged_unpack)
# Method 4: Manual loop
manual = []
for item in list1:
manual.append(item)
for item in list2:
manual.append(item)
print("Manual loop:", manual)