The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →In Python, the right way to reverse an “array” depends on its type and whether you want to change the original. For a built-in list, use items.reverse() to reverse it in place, items[::-1] or list(reversed(items)) to make a new list, and reversed(items) to iterate backward without making a list. Python’s standard-library array.array is a separate type with its own in-place reverse() method.
First, identify what “array” means in your Python code
Python’s built-in list is the sequence most examples mean when they say “array,” but it is not the same type as array.array or a third-party array such as NumPy’s. These types have different characteristics, so choose a method for the object you actually have. The Python FAQ covers reverse iteration over sequences; the standard-library array documentation describes array.array.
As an Amazon Associate I earn from qualifying purchases.
The examples below use items = [1, 2, 3, 4]. Their central difference is whether they modify items, produce a new list, or simply traverse the values in reverse order.
Free tools Windows power users keep installed
One-click scans. No signup required.
Reverse a built-in list in five ways
1. Reverse the list in place with list.reverse()
items = [1, 2, 3, 4]
items.reverse()
print(items) # [4, 3, 2, 1]
reverse() changes the existing list and returns None. Call it as a statement; do not write items = items.reverse(), which replaces the list reference with None. The Python list tutorial documents list methods that modify the list in place.
#1 Best Overall
2. Make a reversed list with a slice
items = [1, 2, 3, 4]
reversed_items = items[::-1]
print(reversed_items) # [4, 3, 2, 1]
print(items) # [1, 2, 3, 4]
The slice [::-1] uses a step of -1, giving a reversed list while leaving the original list order unchanged. Use it when you want a list result and do not want to mutate the source.
3. Make a list from reversed()
items = [1, 2, 3, 4]
reversed_items = list(reversed(items))
print(reversed_items) # [4, 3, 2, 1]
print(items) # [1, 2, 3, 4]
The built-in reversed() produces an iterator, not a list. Wrapping it in list() consumes that iterator and materializes the values in reverse order. The Python built-in functions reference describes reversed() as returning a reverse iterator.
Rank #2
4. Iterate backward without making a new list
items = [1, 2, 3, 4]
for item in reversed(items):
print(item)
This visits 4, 3, 2, then 1, without changing items or building a reversed list. Choose it when you only need to process values in reverse order. The Python FAQ recommends reversed() for traversing a sequence backward without touching the original.
Recommended Free Tools
5. Swap elements with a two-index loop
items = [1, 2, 3, 4]
left = 0
right = len(items) - 1
while left < right:
items[left], items[right] = items[right], items[left]
left += 1
right -= 1
print(items) # [4, 3, 2, 1]
The loop swaps the outermost pair, then moves both indices toward the center. It changes the original list. This makes the algorithm visible for learning, but for ordinary list reversal the built-in reverse() method is clearer.
Reverse a standard-library array.array
6. Use array.array.reverse()
from array import array
values = array("i", [1, 2, 3, 4])
values.reverse()
print(values) # array('i', [4, 3, 2, 1])
array.array is a mutable, typed sequence for constrained basic values, rather than a built-in list. Its reverse() method reverses the elements in place. The type code determines the stored value type, and representation details can depend on machine architecture; see the official array reference.
Choose by the result you need
| Need | Use | Changes original? | Result |
|---|---|---|---|
| Reverse a built-in list itself | items.reverse() |
Yes | The same list, reversed |
| A reversed list, keeping the source order | items[::-1] |
No | A new list |
| A reversed list via the reverse iterator | list(reversed(items)) |
No | A new list |
| Process values from last to first | for item in reversed(items) |
No | Reverse-order iteration |
| Learn the swapping algorithm | Two-index loop | Yes | The same list, reversed |
| Reverse a standard-library typed array | values.reverse() |
Yes | The same array.array, reversed |
For NumPy arrays or another third-party array type, consult that library’s documentation rather than assuming the built-in list or array.array behavior applies.
Quick Recap
Best Value
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.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →




