Python list.append() Method

Beginner
6 min read
Updated: Nov 2026
3 examples
list method

Definition

append() adds exactly one item to the end of a list. The list grows by one and is changed in place: no new list is created, and every name that refers to the list sees the new item.

The item can be anything: a number, a string, None, a dict, or another list. Appending a list adds it as one nested element; to add each of its items separately, use extend().

list.append() is an instance method of the built-in list type: call it on a list with dot notation, such as tasks.append(...). No import is needed.

Syntax

Pass the single item to add, and call it on its own line, because the return value is always None.

python
lst.append(item)
CallWhat it does
[1, 2].append(3)Returns None; the list becomes [1, 2, 3].
[1, 2].append([3, 4])Returns None; the list becomes [1, 2, [3, 4]], with only three items.
tasks = tasks.append("x")A bug: the item is added, but then tasks is rebound to None and the list is lost.

Appending at the end is fast no matter how long the list is. To add at another position use insert(); to add many items at once use extend() or +=.

Method signatures
python
list.append(item)
# returns: None; item is now the last element of the list

Parameters

ParameterDescription
itemAny object, added as a single element. Exactly one positional argument is required: append(1, 2) and append(item=1) both raise TypeError.

Return Value

Return ValueDescription
NoneAlways None. The useful result is the list itself, which is now one item longer.

Python Examples

Example 1 — Grow a Daily To-Do List

Add tasks one at a time and print what append() itself returns.

python
todo = ["buy milk", "call mom"]
print(todo.append("pay rent"))
print(todo)

todo.append("water plants")
print(len(todo), todo[-1])

How It Works

  1. The return value is None. print(todo.append("pay rent")) still adds the task, but the method hands back None, and that is what gets printed.
  2. Changed in place. Printing todo afterwards shows the new task at the end; no second list was made.
  3. Always the end. The next call adds "water plants" after "pay rent", so the list now holds four tasks.
  4. Negative index for the newest. todo[-1] reads the item that was appended last.

Example 2 — Add a Whole Album to a Playlist

Appending a list puts the whole list in one slot. Extending adds each song separately.

python
playlist = ["Intro", "Skyline"]
album = ["Rain", "Echo"]

playlist.append(album)
print(playlist)
print(len(playlist), playlist[2][0])

playlist = ["Intro", "Skyline"]
playlist.extend(album)
print(playlist)
print(len(playlist))

How It Works

  1. One item, even if it is a list. append(album) stores the album list as a single element, so the output shows brackets inside brackets.
  2. Only three items. The length is 3, and reaching a song needs two indexes: playlist[2][0] is the first song of the nested album.
  3. extend() unpacks. Starting again and calling extend() adds "Rain" and "Echo" as two separate songs.
  4. Four flat items. The extended playlist has length 4 and no nested list.

Example 3 — Collect Weather Readings as Dicts

Reusing one dict for every reading appends the same object three times. Building a new dict per loop step fixes it.

python
weather = [(6, 14), (12, 21), (18, 17)]

shared = []
row = {}
for hour, temp in weather:
    row["hour"] = hour
    row["temp"] = temp
    shared.append(row)
print(shared)

fresh = []
for hour, temp in weather:
    fresh.append({"hour": hour, "temp": temp})
print(fresh)
print(fresh[0] is fresh[1], shared[0] is shared[1])

How It Works

  1. References, not copies. The first loop appends the same row dict three times and overwrites its values on every pass.
  2. Last values everywhere. All three slots show hour 18, because they are one dict that ended with the final reading.
  3. New dict each time. The dict literal inside the second loop creates a fresh object per reading, so each slot keeps its own hour and temperature.
  4. Identity check. is confirms that the fresh records are different objects while the shared ones are a single object.

Frequently Asked Questions

It returns None. The item is added to the list in place, so use the list itself afterwards instead of the return value.
append(x) adds x as one item, even if x is a list. extend(iterable) loops over the iterable and adds each of its items separately.
Use lst.extend([a, b, c]) or lst += [a, b, c]. Calling append() with several arguments raises TypeError.
Use lst.insert(0, item). If you do this a lot on a long list, a collections.deque with appendleft() is faster.
You probably wrote lst = lst.append(x). append() returns None, so the assignment throws the list away. Call lst.append(x) on its own line.

Next: list.clear()

Remove every item in place, leaving an empty list.

clear() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful