Python List append() Method
The append() method adds one item to the end of a Python list.
Use it when you want to grow a list step by step. This method changes the original list directly, so it does not create a new list.
Quick answer #
numbers = [1, 2, 3]
numbers.append(4)
print(numbers)
# [1, 2, 3, 4]
Use append() to add one item to the end of a list. It changes the original list.
What append() does #
append()adds one item to the end of a list- It changes the existing list in place
- It does not create a new list
- It can add any Python object as one item
This means you can append:
- numbers
- strings
- booleans
- lists
- dictionaries
- custom objects
If you need a broader introduction to lists first, see Python lists explained for beginners.
Syntax #
Basic form:
my_list.append(item)
my_listis the list you want to changeitemis the value or object to add- The method returns
None
Example:
fruits = ["apple", "banana"]
result = fruits.append("orange")
print(fruits)
print(result)
Output:
['apple', 'banana', 'orange']
None
The important detail is that append() updates fruits, but the method itself returns None.
Simple example #
Start with a short list, append one value, then print the list.
colors = ["red", "blue"]
colors.append("green")
print(colors)
Output:
['red', 'blue', 'green']
The new item becomes the last item in the list.
If you want a task-focused guide, see how to add an item to a list in Python.
Appending different data types #
You can append many kinds of values.
items = []
items.append(10)
items.append("hello")
items.append(True)
items.append({"name": "Sam"})
items.append([1, 2, 3])
print(items)
Output:
[10, 'hello', True, {'name': 'Sam'}, [1, 2, 3]]
A list added with append() becomes one single item.
numbers = [1, 2]
numbers.append([3, 4])
print(numbers)
Output:
[1, 2, [3, 4]]
Notice that [3, 4] was added as one nested list item.
This is different from list.extend(), which adds items one by one from another iterable.
append() vs extend() #
This is one of the most common beginner questions.
Using append() #
numbers = [1, 2]
numbers.append([3, 4])
print(numbers)
Output:
[1, 2, [3, 4]]
Using extend() #
numbers = [1, 2]
numbers.extend([3, 4])
print(numbers)
Output:
[1, 2, 3, 4]
The difference:
append([3, 4])adds one item: the whole listextend([3, 4])adds two separate items- Use
append()for one item - Use
extend()for multiple items from another iterable
For the full method reference, see Python list extend() method.
Common beginner mistakes #
Assigning the result of append() #
This is a very common mistake:
items = [1, 2, 3]
items = items.append(4)
print(items)
Output:
None
Why this happens:
append()changes the list in placeappend()returnsNone- So
items = items.append(4)replaces your list withNone
Correct version:
items = [1, 2, 3]
items.append(4)
print(items)
Output:
[1, 2, 3, 4]
Expecting append() to return the updated list #
Wrong idea:
updated = [1, 2].append(3)
print(updated)
Output:
None
Remember: append() updates the list you already have.
Using append() when extend() is needed #
numbers = [1, 2]
numbers.append([3, 4])
print(numbers)
Output:
[1, 2, [3, 4]]
If you expected [1, 2, 3, 4], use extend() instead.
Forgetting that append() always adds at the end #
append() cannot choose a position. It always adds the new item at the end of the list.
If you need to add an item at a specific index, use list.insert().
Example:
letters = ["a", "c"]
letters.insert(1, "b")
print(letters)
Output:
['a', 'b', 'c']
When to use append() #
append() is useful when you are adding items one at a time.
Common cases:
- building a list in a loop
- collecting user input
- storing results step by step
- adding one new item to existing data
Example with a loop:
squares = []
for number in range(1, 5):
squares.append(number * number)
print(squares)
Output:
[1, 4, 9, 16]
FAQ #
Does append() return a new list? #
No. append() changes the original list and returns None.
Can append() add multiple items at once? #
No. It adds one item. To add multiple items from another iterable, use extend().
What happens if I append a list? #
The whole list is added as one item at the end, creating a nested list.
Example:
data = [1, 2]
data.append([3, 4])
print(data)
Output:
[1, 2, [3, 4]]
What is the difference between append() and insert()? #
append() adds at the end. insert() adds at a specific position.