Last modified: May 30, 2026

Python List Append to End

Adding items to a list is a common task in Python. The append() method is the simplest way to add an element to the end of a list. It modifies the original list in place.

This method is fast and easy to use. It only takes one argument, the item you want to add. You can add any data type, including numbers, strings, or even other lists.

In this guide, you will learn how to use append() effectively. We will cover syntax, examples, and best practices. By the end, you will be confident in adding items to lists.

What is Append?

The append() method belongs to Python's list class. It adds a single element to the end of the list. The list grows by one element after the operation.

It does not return a new list. Instead, it updates the original list. This is called an in-place operation.

Here is the basic syntax:


# Syntax: list.append(element)
my_list = [1, 2, 3]
my_list.append(4)
print(my_list)

[1, 2, 3, 4]

As you can see, the number 4 is added at the end. The original list is changed.

Why Use Append?

Using append() is the most efficient way to add one item to the end of a list. It has a time complexity of O(1). This means it takes constant time, no matter how large the list is.

It is perfect for building lists dynamically. For example, when reading data from a file or user input, you can append each item as you go.

Other methods like insert() are slower for adding to the end. If you need to add multiple items, consider using extend() or concatenation. But for a single item, append() is the best choice. For more on inserting at specific positions, check out our Python List Insert Syntax Guide.

Append Different Data Types

You can append any Python object to a list. This includes strings, integers, floats, booleans, and even other lists.

Here are some examples:


# Append a string
fruits = ["apple", "banana"]
fruits.append("cherry")
print(fruits)

# Append an integer
numbers = [1, 2]
numbers.append(3)
print(numbers)

# Append a boolean
flags = [True, False]
flags.append(True)
print(flags)

# Append a list (nested list)
my_list = [1, 2]
my_list.append([3, 4])
print(my_list)

['apple', 'banana', 'cherry']
[1, 2, 3]
[True, False, True]
[1, 2, [3, 4]]

Notice that when you append a list, it becomes a single element. The inner list is not merged. It is added as one item.

Append in Loops

One of the most common uses of append() is inside loops. This lets you build a list step by step.

For example, you can create a list of squares:


# Build a list of squares
squares = []
for i in range(5):
    squares.append(i ** 2)
print(squares)

[0, 1, 4, 9, 16]

You can also filter items from another list. Here we keep only even numbers:


# Filter even numbers
original = [1, 2, 3, 4, 5, 6]
evens = []
for num in original:
    if num % 2 == 0:
        evens.append(num)
print(evens)

[2, 4, 6]

This pattern is very useful. It helps you create lists based on conditions.

Append vs Extend

Many beginners confuse append() with extend(). They are different.

append() adds one element to the end. If you pass a list, it becomes a nested list.

extend() adds each element from an iterable to the end. It flattens the input.

Here is a comparison:


# Using append
list_a = [1, 2]
list_a.append([3, 4])
print("Append:", list_a)

# Using extend
list_b = [1, 2]
list_b.extend([3, 4])
print("Extend:", list_b)

Append: [1, 2, [3, 4]]
Extend: [1, 2, 3, 4]

Use append() for a single item. Use extend() to merge two lists.

Common Mistakes

One common mistake is trying to use append() with multiple arguments. It only takes one argument.


# Wrong - will raise TypeError
my_list = [1, 2]
# my_list.append(3, 4)  # This is wrong

Another mistake is forgetting that append() modifies the list in place. It does not return the new list. If you try to assign it, you will get None.


# Wrong - returns None
my_list = [1, 2]
new_list = my_list.append(3)
print(new_list)  # None
print(my_list)   # [1, 2, 3]

Always remember: append() changes the original list. It does not give you a new one.

Performance Tips

For large lists, append() is very efficient. It runs in O(1) time. However, if you need to add many items, consider using list comprehension or extend() for better readability.

If you need to check the length of your list before appending, see our Python List Length Check with If guide.

Also, if you need to count how many times an item appears, check out Python List Count: Easy Guide.

Avoid using insert(0, item) for adding to the beginning. It is slow for large lists. Use append() and then reverse if needed.

Conclusion

The append() method is a simple and powerful tool in Python. It adds one element to the end of a list efficiently. You can use it with any data type and inside loops.

Remember that it works in place and takes only one argument. For adding multiple items, use extend() or list comprehension. Practice using append() in your projects to build dynamic lists.

Now you know how to use Python list append to end. Start coding and add items to your lists with confidence.