Slice notation in short:

[ <first element to include> : <first element to exclude> : <step> ]

If you want to include the first element when reversing a list, leave the middle element empty, like this:

foo[::-1]

You can also find some good information about Python slices in general here:
Explain Python's slice notation

Answer from Andrew Clark on Stack Overflow
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ reversing a list using slice
r/learnpython on Reddit: Reversing a list using slice
December 23, 2023 -
list[::-1]

I learned this years ago but never thought about it until reviewing just now. Why is it

[::-1]

? Does the first colon(:) mean we start at the beginning, and the second colon(:) mean we end also at the beginning?

๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ how-to-reverse-a-list-in-python-using-slicing
How To Reverse A List In Python Using Slicing - GeeksforGeeks
February 20, 2024 - In the example we first reverse the entire list ([::-1]) and then use slicing to extract elements in pairs, reversing them ([::2] and [1::2]). Finally, we concatenate these two sliced lists to form the reversed list with elements reversed in pairs.
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ python reverse list with slicing โ€” an illustrated guide
Python Reverse List with Slicing - An Illustrated Guide - Be on the Right Side of Change
October 1, 2020 - You can use a negative step size (e.g., -1) to slice from the right to the left in inverse order. Hereโ€™s how you can use this to reverse a list in Python:
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-reverse-list-reversing-an-array-in-python
Python Reverse List โ€“ Reversing an Array in Python
September 6, 2022 - Slicing is one of the fastest ways to reverse a list in Python and offers a concise syntax. That said, it is more of an intermediate to advanced feature and not that beginner friendly compared to the .reverse() method, which is more intuitive and self-descriptive. Let's go over a quick overview of how slicing works. The general syntax looks something like the following: list_name[start:stop:step] Let's break it down: start is the beginning index of the slice, inclusive.
๐ŸŒ
Real Python
realpython.com โ€บ python-reverse-list
Reverse Python Lists: Beyond .reverse() and reversed() โ€“ Real Python
June 28, 2023 - The slice object extracts all the items from digits, starting from the right end back to the left end, and returns a reversed copy of the target list. ... So far, youโ€™ve seen a few tools and techniques to either reverse lists in place or create reversed copies of existing lists. Most of the time, these tools and techniques are the way to go when it comes to reversing lists in Python.
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python
Reverse a List, String, Tuple in Python: reverse, reversed | note.nkmk.me
August 16, 2023 - In Python, you can reverse a list using the reverse() method, the built-in reversed() function, or slicing. To reverse a string (str) and a tuple, use reversed() or slicing. Reverse a list using the r ...
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ python list reverse()
Python List reverse() - Scaler Topics
May 7, 2024 - The slicing technique in Python allows you to reverse a list by specifying the start, stop, and step parameters in slice notation list[::-1]. This method creates a new reversed list.
Find elsewhere
๐ŸŒ
Delft Stack
delftstack.com โ€บ home โ€บ howto โ€บ python โ€บ reverse order using slicing in python
How to Reverse Order Using Slicing in Python | Delft Stack
March 4, 2025 - By applying the slicing method [::-1], we generate a new string reversed_string that contains the characters of my_string in reverse order. Just like with lists, this approach is straightforward and efficient, allowing you to easily reverse ...
๐ŸŒ
Python Morsels
pythonmorsels.com โ€บ slicing
List slicing in Python - Python Morsels
March 8, 2024 - Reversing a list is the most common use for the step value when slicing, though I typically prefer to use Python's built-in reversed function instead: >>> list(reversed(fruits)) ['orange', 'lemon', 'pear', 'kiwi', 'lime', 'apple', 'watermelon'] It's important to note that slicing doesn't just work on lists. If we can index an object, we can probably slice it.
๐ŸŒ
LabEx
labex.io โ€บ tutorials โ€บ python-how-to-slice-lists-in-reverse-418691
How to slice lists in reverse | LabEx
graph LR A[Original List] --> B[Reverse Slice] B --> C[Reversed/Partial List] ## Complex reverse slicing mixed_list = [1, 'a', 2, 'b', 3, 'c'] print(mixed_list[::-2]) ## Output: ['c', 2, 'a'] ... LabEx recommends practicing these techniques ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-list-slicing
Python List Slicing - GeeksforGeeks
Explanation: The negative step (-1) indicates that Python should traverse the list in reverse order, starting from the end. The slice a[::-1] starts from the end of the list and moves to the beginning which result in reversing list.
Published ย  July 23, 2025
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-reversing-list
Reversing a List in Python - GeeksforGeeks
The reverse() method or list slicing ([::-1]) are generally recommended for their simplicity and efficiency. ... In Python, a list is a built-in dynamic sized array (automatically grows and shrinks).
Published ย  October 15, 2024
Top answer
1 of 4
6

Let's take a list for example,

a = [1, 2, 3, 4, 4, 5, 6, 9]

If you try to slice it using positive indices,

newa = a[1:5] 

This will result in

newa = [2, 3, 4, 4] 

This is because, in the above case slicing occurs like this, a[inclusive : exclusive], first index is included and slicing begins from this index, and end just one index before the index(5), exclusive(remember). This is just the way how list slicing works.

To get last two values of the list a,

newa = [6 : ]

Here, the index starts from 6(inclusive) and ends till end of the list.

If you are keen in using negative indexing in lists as Python offers to ease up indexing, know once and for all the inclusive and exclusive thing about slicing.

For same example above, to get last two numbers of the list using negative index, what we do is,

newa = a[-2 : ]

In the case of positive indexing, the index begins at 0 while for negative indexing, the index is at -1, -2 and so on. So in the above example, starting from second last number in the list, slice till the end of the list, is what is understood.

Now, to reverse the list, one could do,

print a.reverse()
[9, 6, 5, 4, 4, 3, 2, 1]

In slicing way, list can be reversed by giving it a [start, end, step] like mentioned above, but I would like to clarify it further.

 r = a[2: : -1]

This will make a new list starting with number from index 2, and till the end of the list, but since the step is -1, we decrease from index 2, till we reach 0. Hence we come up with a reversed list of first three numbers as below:

r = [3, 2, 1]

Also, to get a whole of the list as reversed,

r = a[len(a): : -1]

This will start from 8, the length of the list, but in indices terms which begins from 0, we have 0 till 8 indices, so starting from 8th indices, it goes on decreasing in steps of -1, till the end of the list. The result is as:

[9, 6, 5, 4, 4, 3, 2, 1]

I personally prefer to use this for reversing the list.

2 of 4
3

For the Python list slicing syntax, list[start:end:step] will get a sliced list with items starting with list[start], but list[end] is excluded. As a result, in your case, L[10:0:-1] will exclude L[0], i.e., 0, and L[10::-1] will work as you expect.

When the start or end is a negative number, it means it counts from the end of the list. So list[-1] will get the last item in the list. In your case, L[10:-1:-1] is equivalent to L[10:10:-1]. So L[10:-1:-1] will get [].

๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ python-reverse-list
Python Reverse List: How to Reorder Your Data | DataCamp
February 27, 2025 - If you're starting your Python ... concepts like list handling and data structures. The easiest way to reverse a list in Python is using slicing ([::-1]), which creates a new reversed list without modifying the original:...
๐ŸŒ
Flexiple
flexiple.com โ€บ python โ€บ reversing-list-python
Reversing A List In Python - Flexiple
This method creates a new list that is the reverse of the original, ensuring that the original list remains unchanged. In this technique, we utilize the slicing operator by providing two colons (::) followed by -1. This tells Python to start ...
๐ŸŒ
Cherry Servers
cherryservers.com โ€บ home โ€บ blog โ€บ python โ€บ how to reverse a list in python (using 3 simple ways)
How to Reverse a List in Python (Using 3 Simple Ways) | Cherry Servers
November 7, 2025 - Benefit from an open cloud ecosystem with seamless API & integrations and a Python library. ... To reverse a list in Python, two basic methods are commonly used, the built-in reverse() method and slicing with [::-1].
๐ŸŒ
dbader.org
dbader.org โ€บ blog โ€บ python-reverse-list
How to Reverse a List in Python โ€“ dbader.org
July 11, 2017 - A step-by-step tutorial on the three main ways to reverse a Python list or array: in-place reversal, list slicing, and reverse iteration.