Last modified: Nov 10, 2026

Concatenate Two Lists in Python: Simple Methods Explained

Python lists are essential data structures that allow you to store multiple items in a single variable. Sometimes you need to combine two separate lists into one. This is where list concatenation comes in handy. In this guide, we will explore different methods to concatenate two lists in Python with clear examples.

What Does It Mean to Concatenate Lists?

Concatenation means joining two or more sequences end-to-end. When you concatenate two lists, you create a new list containing all elements from both original lists. The order of elements is preserved from the original lists.

For example, if you have list1 = [1, 2, 3] and list2 = [4, 5, 6], concatenating them would give you [1, 2, 3, 4, 5, 6].

Method 1: Using the + Operator

The simplest way to concatenate two lists is by using the + operator. This method creates a new list without modifying the original lists.


# Define two lists
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# Concatenate using + operator
combined_list = list1 + list2

print(combined_list)
# Output: [1, 2, 3, 4, 5, 6]

This approach is straightforward and easy to understand. However, it creates a new list in memory, which might not be efficient for very large lists.

Method 2: Using the extend() Method

The extend() method modifies the original list by adding elements from another list. This is more memory-efficient when you don't need to keep the original list unchanged.


# Define two lists
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# Extend list1 with elements from list2
list1.extend(list2)

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

Notice that after using extend(), list1 contains all elements. The original list2 remains unchanged. This method is useful when you want to modify one of the existing lists.

Method 3: Using List Unpacking with *

Python 3.5+ introduced a more elegant way to concatenate lists using the unpacking operator *. This method creates a new list and is very readable.


# Define two lists
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# Concatenate using unpacking operator
combined_list = [*list1, *list2]

print(combined_list)
# Output: [1, 2, 3, 4, 5, 6]

This syntax is particularly useful when you need to concatenate multiple lists at once. You can extend it to more than two lists easily.

Method 4: Using List Unpacking with ... (Ellipsis)

In Python 3.9+, you can use the ... (ellipsis) operator for list concatenation. This is a cleaner syntax for combining multiple lists.


# Define two lists
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# Concatenate using ellipsis operator
combined_list = [*list1, ...list2]

print(combined_list)
# Output: [1, 2, 3, 4, 5, 6]

Method 5: Using a Loop to Concatenate Lists

For more control over the concatenation process, you can use a loop to add elements one by one. This method is useful when you need to perform additional operations during concatenation.


# Define two lists
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# Create an empty list for the result
combined_list = []

# Add elements from list1
for item in list1:
    combined_list.append(item)

# Add elements from list2
for item in list2:
    combined_list.append(item)

print(combined_list)
# Output: [1, 2, 3, 4, 5, 6]

Method 6: Using List Comprehension

List comprehension offers another creative way to concatenate lists. While not the most common approach, it demonstrates the flexibility of Python.


# Define two lists
list1 = [1, 2, 3]
list2 = [4, 5, 6]

# Concatenate using list comprehension
combined_list = [item for sublist in [list1, list2] for item in sublist]

print(combined_list)
# Output: [1, 2, 3, 4, 5, 6]

When to Use Each Method

Choosing the right method depends on your specific needs:

  • Using + operator: Best for simple concatenation when you need a new list and don't want to modify originals.
  • Using extend(): Ideal when you want to modify one list and save memory.
  • Using unpacking (*): Great for readability and when working with Python 3.5+.
  • Using loops: Useful when you need to perform additional operations during concatenation.

Concatenating Lists with Different Data Types

You can concatenate lists containing different data types just as easily.


# Lists with different data types
fruits = ['apple', 'banana', 'cherry']
numbers = [1, 2, 3]
mixed_list = fruits + numbers

print(mixed_list)
# Output: ['apple', 'banana', 'cherry', 1, 2, 3]

Concatenating Nested Lists

When working with nested lists, concatenation joins them at the top level.


# Nested lists
nested1 = [[1, 2], [3, 4]]
nested2 = [[5, 6], [7, 8]]

# Concatenate at top level
combined = nested1 + nested2

print(combined)
# Output: [[1, 2], [3, 4], [5, 6], [7, 8]]

If you need to flatten nested lists after concatenation, you can use techniques like Python Flatten a Nested List: Easy Guide.

Performance Considerations

For small to medium-sized lists, all methods perform similarly. However, for very large lists, consider:

  • The extend() method is most memory-efficient.
  • List comprehension can be faster than loops.
  • The + operator creates a copy, which uses more memory.

Common Use Cases

List concatenation is useful in many scenarios:

  • Combining user inputs from multiple sources.
  • Merging configuration settings.
  • Building result sets from multiple queries.
  • Processing data from different sensors or files.

Practice Exercises

Try these exercises to reinforce your understanding:

  1. Concatenate two lists of your choice and print the result.
  2. Use the extend() method to modify one of your lists.
  3. Try concatenating three lists using the unpacking operator.

Conclusion

Concatenating two lists in Python is straightforward with several available methods. The + operator is the most intuitive for beginners, while extend() offers memory efficiency. For modern Python versions, unpacking operators provide clean, readable syntax. Choose the method that best fits your specific requirements, considering factors like memory usage, code readability, and whether you need to preserve the original lists.

Understanding these techniques will help you work more effectively with Python lists in your projects. Practice with different data types and sizes to become comfortable with all the methods.