Python lists have 11 built-in methods for adding, removing, finding, ordering, and copying items. The key choice is usually whether you want to change the existing list or produce a value to use elsewhere: most list methods that change a list return None, while pop() returns the item it removes.
Python list methods at a glance
The following methods are documented for Python lists in the Python 3.14.7 tutorial. “Mutates” means the method changes the existing list rather than creating a replacement.
| Method | Use | Result and notable failure |
|---|---|---|
append(x) |
Add one item at the end | Mutates the list; returns None. |
extend(iterable) |
Add each item from an iterable | Mutates the list; returns None. |
insert(i, x) |
Insert an item before position i |
Mutates the list; returns None. |
remove(x) |
Remove the first item equal to x |
Mutates the list; raises ValueError if no equal item exists. |
pop([i]) |
Remove and retrieve the item at position i; defaults to the last item |
Returns the removed item; raises IndexError for an invalid position or an empty list. |
clear() |
Remove all items | Mutates the list; returns None. |
index(x[, start[, stop]]) |
Find the first matching item, optionally within a slice range | Returns its index in the whole list; raises ValueError if no match is found. |
count(x) |
Count items equal to x |
Returns an integer. |
sort(key=None, reverse=False) |
Order the existing list | Mutates the list; returns None. |
reverse() |
Reverse the current order | Mutates the list; returns None. |
copy() |
Make a shallow copy | Returns a new outer list whose nested objects are shared. |
These behaviors and signatures are described in the Python 3.14.7 tutorial, “Data Structures”.
How to add items: append, extend, and insert
Use append() for one item
append(x) places its argument at the end as a single element. If that argument is itself a list, the nested list remains one item:
#1 Best Overall
items = ["red", "blue"]
items.append(["green", "yellow"])
# ['red', 'blue', ['green', 'yellow']]
Use extend() for items from an iterable
extend(iterable) adds the iterable’s elements one by one. To add the colors as separate elements, pass the list to extend() instead:
items = ["red", "blue"]
items.extend(["green", "yellow"])
# ['red', 'blue', 'green', 'yellow']
In short, append(collection) adds the collection as one item; extend(collection) adds the collection’s contents.
Use insert() for a position
insert(i, x) places x before index i. For example, items.insert(1, "amber") puts "amber" at index 1 and shifts the later items along. Use append() when the item belongs at the end; use insert() when its position matters.
Rank #2
How to remove items: remove, pop, and clear
Use remove() when you know the value
remove(x) deletes the first item equal to x, not every matching item. It raises ValueError if the list contains no equal value.
Use pop() when you need the removed item
pop(i) removes and returns the item at index i; leaving out the index removes the last item. Because it returns the item, you can save it for later:
tasks = ["draft", "review", "publish"]
next_task = tasks.pop()
# next_task is 'publish'; tasks is ['draft', 'review']
An out-of-range index raises IndexError, as does calling pop() on an empty list.
Use clear() to empty the existing list
clear() removes every item from the list. It changes that list in place and returns None.
How to inspect a list: index() and count()
Find a position with index()
index(x) returns the index of the first item equal to x. Optional start and stop arguments limit where the search occurs, but the result is still an index in the original list. If no matching value is found in the search range, the method raises ValueError.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCount matches with count()
count(x) returns the number of items equal to x, including zero when there are no matches.
How to reorder a list: sort(), sorted(), and reverse()
Use sort() to change the existing list
sort() orders the list in place and returns None. The optional key function determines the value used for ordering, and reverse=True requests descending order:
names = ["Mina", "Alex", "Jo"]
names.sort(key=len)
# names is ['Jo', 'Mina', 'Alex']
Elements must be orderable under the comparison or key used. If Python cannot compare the relevant values, sorting fails rather than inventing an ordering.
Use sorted() to make a new ordered list
If the original list must remain unchanged, call sorted(items). It returns a new sorted list instead of modifying items. Do not assign the result of items.sort() expecting a sorted list; that result is None.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
Use reverse() to flip the current order
reverse() reverses the sequence as it stands; it does not sort values into ascending or descending order. Like sort(), it changes the existing list and returns None.
How to copy a list: copy() and nested values
copy() creates a new outer list, but it is a shallow copy. If the list contains mutable objects such as other lists, both the original and the copy refer to those same nested objects. Changing a nested object through one list is therefore visible through the other; copying the outer list does not recursively duplicate its contents.
original = [[1, 2], [3, 4]]
duplicate = original.copy()
duplicate[0].append(99)
# original is [[1, 2, 99], [3, 4]]
Why list methods often return None
Methods such as append(), insert(), remove(), sort(), and reverse() change the list directly. The Python tutorial explains: “You might have noticed that methods like insert, remove or sort that only modify the list have no return value printed – they return the default None.” This is why chaining an in-place operation as though it produced a list can cause errors.
Quick Recap
Choose the method by the task
- Add one item, including a collection as a single nested item:
append(). - Add the elements of an iterable:
extend(). - Insert one item before a particular position:
insert(). - Remove the first matching value:
remove(). - Remove an item by position and keep its value:
pop(). - Empty the list:
clear(). - Find a first matching position or count matches:
index()orcount(). - Sort the existing list or make a sorted copy:
sort()orsorted(). - Reverse the current sequence:
reverse(). - Make a shallow outer-list copy:
copy().
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.




