October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

Append One List to Another in Python Without Nesting

Add the contents of one Python list to another with extend(), and learn when append() or + is the better choice.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use first.extend(second) to add every item in second to the end of first without nesting the lists. It changes first in place.

Use extend() to add the items

The Python 3.14 tutorial defines list.extend(iterable) as “Extend the list by appending all the items from the iterable.” Python’s list documentation shows the method’s behavior:

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

first.extend(second)
print(first)  # [1, 2, 3, 4]

Each item from second becomes an individual element at the end of first. The original first list is modified.

Why append() creates nesting

append() adds its argument as one object. So first.append(second) puts the entire second list inside the first:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
first = [1, 2]
second = [3, 4]

first.append(second)
print(first)  # [1, 2, [3, 4]]

Use this only when you deliberately want second to be a single nested element. To add one ordinary value, such as 5, use first.append(5).

Choose the operation that matches the result

Goal Code Result
Add every item from second to the existing first first.extend(second) Changes first in place
Create a new list containing both lists’ items combined = first + second Creates a concatenated list; leaves both inputs unchanged
Add second as one item first.append(second) Adds a nested list
Add one value first.append(value) Adds that value as one element

Python also supports first += second for in-place list extension. For beginners, first.extend(second) makes the intent explicit. Python’s augmented-assignment documentation describes the distinction between augmented assignment and ordinary addition.

Remember that extend() accepts any iterable

extend() is not limited to lists: it adds items from an iterable one at a time. For example, extending with a string adds its characters individually:

letters = []
letters.extend("cat")
print(letters)  # ['c', 'a', 't']

If the whole string should be one element, use letters.append("cat") instead.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not assign the return value of extend()

extend() changes the list and returns None. Call it directly:

first.extend(second)

Do not write first = first.extend(second); that replaces the list variable with None.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Version and scope

This guidance applies to Python’s built-in list type. The same append() and extend() distinction appears in the Python 3.11 tutorial as well as the current Python 3.14 tutorial; it should not be assumed for third-party arrays or custom containers with similarly named methods.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.