Take the content of a list and append it to another list

43    Asked by AadityaSrivastva in Python , Asked on Jul 18, 2025

This guide will explain different ways to append all elements of one list into another, using methods like extend(), the += operator, and loops.

Answered by Adeline Mooney

To take the contents of one list and append them to another in Python, you have several effective options. The goal is to add the individual elements of one list to the end of another, rather than nesting the entire list as a single item.

Here are the most common methods:

1. Using extend()

The extend() method adds each element from one list into another.

list1 = [1, 2, 3]
list2 = [4, 5, 6]
list1.extend(list2)
print(list1) # Output: [1, 2, 3, 4, 5, 6]

This is a clean and direct way to merge two lists.

2. Using += operator

This is similar to extend() and works well when both variables are lists.

list1 = [1, 2, 3]
list2 = [4, 5, 6]
list1 += list2
print(list1) # Output: [1, 2, 3, 4, 5, 6]

It’s concise and very readable.

3. Using a loop

If you need more control (e.g., filtering elements before adding), a loop helps:

list1 = [1, 2, 3]
list2 = [4, 5, 6]
for item in list2:
    list1.append(item)

Summary:

  • Use extend() or += when you want to merge lists element by element.
  • Use append() only if you want to add a list as a single element (e.g., list1.append(list2) → [[1, 2, 3], [4, 5, 6]]).
  • A loop offers more control for custom logic.



Your Answer

Interviews

Parent Categories