🔗 How to Join Lists in Python – The Right Way to Combine Lists | TechTown.in
In Python, combining multiple lists into one is a common task — whether you’re merging product data, appending search results, or building menus.
Thankfully, Python provides multiple clean and efficient ways to join lists, depending on your use case.
This guide will show you how to join Python lists using the + operator, extend(), loops, unpacking, and even list comprehensions — with examples and pro tips.
➕ 1. Using + Operator (Concatenation)
The simplest and most common way to join two or more lists:
list1 = ["a", "b", "c"]
list2 = [1, 2, 3]
joined = list1 + list2
print(joined) # ['a', 'b', 'c', 1, 2, 3]
✅ It returns a new list without changing the originals.
🧩 2. Using extend() Method
extend() adds the elements of one list to the end of another:
list1 = ["x", "y"]
list2 = [10, 20]
list1.extend(list2)
print(list1) # ['x', 'y', 10, 20]
📌 Modifies the original list (list1) in-place.
🔁 3. Using a for Loop
You can also use a loop to manually append items:
list1 = ["red", "green"]
list2 = ["blue", "yellow"]
for color in list2:
list1.append(color)
print(list1) # ['red', 'green', 'blue', 'yellow']
✅ Useful when you want more control during the join.
🌟 4. Using List Comprehension
A compact and Pythonic way to merge multiple lists:
list1 = [1, 2]
list2 = [3, 4]
combined = [item for lst in (list1, list2) for item in lst]
print(combined) # [1, 2, 3, 4]
📦 5. Using * (Unpacking)
Since Python 3.5, you can use the unpacking operator * to merge lists:
list1 = [10, 20]
list2 = [30, 40]
list3 = [50]
merged = [*list1, *list2, *list3]
print(merged) # [10, 20, 30, 40, 50]
✅ Clean and highly readable for joining multiple lists at once.
⚠️ Joining Lists vs Nesting Lists
Be careful not to nest lists when you actually want to merge them:
wrong = [list1, list2] # Creates a list of lists!
# [['a', 'b'], [1, 2]]
Use +, extend(), or unpacking instead of wrapping in another list.
🧠 Summary – Ways to Join Lists in Python
| Method | Description | Changes Original? |
|---|---|---|
list1 + list2 | Concatenate, returns new list | ❌ No |
list1.extend(list2) | Adds list2 to list1 (in-place) | ✅ Yes |
for loop + append | Manual merging, full control | ✅ Yes |
| List comprehension | Elegant and flexible | ❌ No |
Unpacking [*a, *b] | Cleanest for multi-list merge | ❌ No |
🏁 Final Thoughts
Knowing how to join lists in Python is a basic yet powerful skill that’s useful across data science, automation, web development, and more. Choose your method based on whether you want to preserve original lists, write clean code, or perform custom joins.
📘 Keep exploring Python list tutorials at TechTown.in

