HOWTO · Python

7 Ways to Concatenate Two or More Lists in Python

Learn how to concatenate two or more Python lists with +, extend(), +=, iterable unpacking, itertools.chain(), loops, and list comprehensions, then choose an approach based on mutation and result type.

On this page

Concatenate lists with + when you want a new list, or use extend() or += when you want to add items to an existing list. For several lists, iterable unpacking is concise; itertools.chain() is useful when you want to process the values as an iterator. The examples below use the same lists so you can compare each result.

Python lists hold ordered items and can be combined in several ways. Choose based on whether the original list should change and whether the next step needs a list or an iterator.

Concatenate Lists with the + Operator

The + operator creates a new list and leaves both inputs unchanged. It works with two or more lists, and each additional + combines another list.

first = [1, 2, 3]
second = [4, 5]
third = [6, 7]
combined = first + second + third
print(combined)

For example, assigning first = first + second makes first refer to the new combined list; it does not extend the original list object in place. Use + when keeping the source lists available is useful.

Extend a List with extend()

extend() adds each item from an iterable to the end of the list on which it is called. It changes that list and returns None, so keep the destination list in a variable instead of assigning the method call’s result.

first = [1, 2, 3]
second = [4, 5]
first.extend(second)

This is different from first.append(second): append() adds second as one nested item, while extend() adds its items individually. The iterable can be a list, tuple, or another iterable.

Use += to Extend a List In Place

For a list, += adds the items from its right-hand iterable to the existing list, much like extend().

first = [1, 2, 3]
second = [4, 5]
first += second

This is a compact choice when you want to update the left-hand list. By contrast, first = first + second creates a new list and binds the name first to it.

Concatenate Lists with Unpacking

Iterable unpacking places each source list’s items into a new list literal. It supports two or more lists and keeps the inputs unchanged.

first = [1, 2, 3]
second = [4, 5]
third = [6, 7]
combined = [*first, *second, *third]

The * expands each iterable within the brackets, producing one flat list. This unpacking form was introduced in Python 3.5 (see PEP 448).

Use itertools.chain()

itertools.chain() yields items from its input iterables in order. It returns an iterator, so wrap it in list() when a concrete list is needed.

from itertools import chain

first = [1, 2, 3]
second = [4, 5]
third = [6, 7]
combined = list(chain(first, second, third))

Keeping the iterator avoids building the combined list up front when you only need to loop over the values. See the Python documentation for itertools.chain().

Concatenate Lists with a Loop or List Comprehension

A loop is useful when each item needs additional handling. append() adds one item at a time, so iterate through each source list to produce a flat result.

lists = [[1, 2, 3], [4, 5], [6, 7]]
combined = []
for current in lists:
    for item in current:
        combined.append(item)

A list comprehension expresses the same traversal compactly:

lists = [[1, 2, 3], [4, 5], [6, 7]]
combined = [item for current in lists for item in current]

Both approaches create a new list. Use the loop when its steps need explanation or extra logic; use the comprehension for a direct flattening expression.

Compare the Methods and Choose One

Approach Changes an input? Result Works with several lists?
+ No New list Yes
extend() Yes, destination list None from the call Call once per source list
+= Yes, left-hand list Mutates the left-hand list in place Apply for each source list
Unpacking No New list Yes
itertools.chain() No Iterator Yes
Loop or comprehension No New list Yes

Use + or unpacking for a readable new list, and extend() or += to grow an existing list. Choose itertools.chain() when an iterator fits the next operation; convert it with list() if later code needs list indexing or list methods. These approaches have different allocation and mutation behavior, but no single performance ranking applies to every input size and workload; measure representative data if runtime or memory is a deciding factor.

Conclusion

For two or more Python lists, use + or unpacking to create a new list, extend() or += to modify a destination list, and itertools.chain() to iterate over items lazily. A loop or comprehension can also build a new flat list when that form suits the surrounding code.