How to Join Two Lists in Python with the + Operator
To put two lists end to end in Python, add them with +: first + second is a new list with the items of first followed by those of second. Neither list changes. This guide joins a list of fruits and a list of vegetables on Python 3.15.2.
Syntax
<new list> = <first list> + <second list>
| Part | What it means |
|---|---|
<first list> | The list whose items come first |
<second list> | The list whose items follow. It has to be a list too |
<new list> | The result: a new list. Both lists you added stay as they were |
The built-in types documentation lists s + t as "the concatenation of s and t", and the tutorial says "Lists also support operations like concatenation".
The Example
The script joins ["apple", "banana"] and ["carrot", "pea"] into a list called basket, prints it, and prints the first list again to show it didn't change.
Prerequisites
- uv and Python 3. This guide uses uv 0.13.10 with Python 3.15.2, in a project made with
uv init.
Step 1: Write the Script
fruits = ["apple", "banana"]
vegetables = ["carrot", "pea"]
basket = fruits + vegetables
print(basket)
print(fruits)

fruits + vegetablesbuilds a new list from the items of both.basketholds that new list.print(fruits)checks the first list afterwards.
Step 2: Run It
uv run python join_lists.py
['apple', 'banana', 'carrot', 'pea']
['apple', 'banana']

basket has all four items in order, and fruits still has its two: + made a new list. The command works unchanged in PowerShell.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Adding a single item: fruits + "carrot" | TypeError: can only concatenate list (not "str") to list | Put the item in a list: fruits + ["carrot"] |
Using append() to join: fruits.append(vegetables) | The second list goes in as one item: ['apple', 'banana', ['carrot', 'pea']] | Use +, or extend() to change the first list |
Expecting + to change the first list | fruits stays the same; only the new list has everything | Keep the result: basket = fruits + vegetables |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
TypeError: can only concatenate list (not "...") to list | One side isn't a list | Wrap the item in [...], or convert the other side with list(...) |
| A list inside your list | append() added the whole second list as one item | Use + or extend() |
FAQ
What's the difference between + and extend()?
+ makes a new list and leaves both lists alone. fruits.extend(vegetables) adds the items to fruits itself, which then prints ['apple', 'banana', 'carrot', 'pea'].
Is there another way to write it?
Unpacking: [*fruits, *vegetables] also gives ['apple', 'banana', 'carrot', 'pea'], and it can join more than two lists or mix in single items.
Conclusion
fruits + vegetables returned a new list with all four items and left fruits as it was. Both sides of + have to be lists; to change a list in place, use extend().
Additional Resources
- Common sequence operations —
s + tand the other operations lists support. - An Informal Introduction to Python: Lists — the tutorial.
- More on Lists —
append(),extend()and the other list methods.
