Accel Thinking

Python Learning Notes

What Is the Difference Between append() and + in Python Lists?

A beginner-friendly Python note on append(), +, extend(), nested lists, and combining list values.

When beginners add items to a Python list, they often mix up append() and +. Both seem to “add something,” but they do different things, especially when the thing you add is another list.

This note focuses on one key difference: append() adds the whole object as one element; + combines two lists into a new list.

Common Mistake

Suppose we have this list:

items = [1, 2]
items.append([3, 4])
print(items)

Many students expect:

[1, 2, 3, 4]

But the actual output is:

[1, 2, [3, 4]]

The list [3, 4] was not unpacked. It was added as one whole element inside items.

Core Idea

append() means: add one element to the end of a list.

The key phrase is “one element.” Whether you pass in a number, a string, or another list, append() treats it as one element.

items = [1, 2]
items.append(3)
print(items)

Output:

[1, 2, 3]

This feels natural because 3 is a single element.

But if you write:

items = [1, 2]
items.append([3, 4])
print(items)

the output is:

[1, 2, [3, 4]]

because the list [3, 4] itself becomes one element.

Use + to Combine Two Lists

If you want [1, 2, 3, 4], use +:

items = [1, 2]
new_items = items + [3, 4]
print(new_items)

Output:

[1, 2, 3, 4]

Here, + connects two lists and creates a new list. It does not put [3, 4] inside as one element; it places 3 and 4 after the original items.

append() Changes the Original List

There is another important difference: append() changes the original list in place.

items = [1, 2]
items.append(3)
print(items)

Output:

[1, 2, 3]

The original items has changed.

But + usually creates a new list:

items = [1, 2]
new_items = items + [3]

print(items)
print(new_items)

Output:

[1, 2]
[1, 2, 3]

This difference will matter later when you learn about list mutability.

Comparison

Code Result Good for
items.append(3) [1, 2, 3] Adding one single element
items.append([3, 4]) [1, 2, [3, 4]] Adding the whole list as one element
items + [3, 4] [1, 2, 3, 4] Combining two lists

extend() Can Add Items One by One

If you want to change the original list and add each item from another list, use extend():

items = [1, 2]
items.extend([3, 4])
print(items)

Output:

[1, 2, 3, 4]

A simple rule:

Practice

  1. If items = [1, 2] , what is items after items.append([3]) ?
  2. If items = [1, 2] , what is the result of items + [3] ?
  3. Challenge: without using + , add [3, 4] item by item to [1, 2] .

One-Sentence Takeaway

append() adds the whole object as one element; + combines two lists into a new list.

Next time you see an extra pair of brackets inside a list, check whether you used append([ ... ]).