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?

Discussions

How do I reverse a part (slice) of a list in Python? - Stack Overflow
1 Is there a way we can reverse a **portion** of a lisr **in-place** on **Python3** using a **built-in** function? ... 1 How can i reverse slice of list in Python? More on stackoverflow.com
๐ŸŒ stackoverflow.com
reverse - Reversing a list slice in python - Stack Overflow
I am trying to reverse slice of a list in python but it returns an empty list. But when I try with whole list, it works fine. Am I missing anything here? l = [1,2,3,4,5,6,7,8] l[::-1] = [8, 7, 6, 5... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Reversing a list using slice
You've asked a very interesting question. Does the first colon(:) mean we start at the beginning, and the second colon(:) mean we end also at the beginning? This is an incorrect framing. The VALUE before the first colon is the beginning and the VALUE after the first colon is the ending. The value after the second colon is the step count. Another thing to keep in mind that the default start and stop values are None. So this is what we end up with: [::-1] == [None:None:-1] >>>alist = [1,2,3] >>>alist[None:None:-1] [3,2,1] People often teach default start and stop values as 0 and len(alist) but that's entirely incorrect. This will actually return an empty list. >>>alist[0:len(alist):-1] [] Now we come to another interesting question. What does [None:None:-1] actually do? I've no clue. Afaik there is no way to return a reversed list if the Stop value isn't None. Which is fucking INSANE. >>>alist[-1:None:-1] [3,2,1] >>>alist[-1:-1:-1] [] >>>alist[-1:0:-1] [3,2] >>>alist[-1:len(alist):-1] [] >>>alist[-1:len(alist)-1:-1] [] >>>alist[len(alist)-1:0:-1] [3, 2] >>>alist[len(alist)-1:-1:-1] ##Should work right? But Nope. [] If someone here knows how to slice reverse, without using or implying None, please tell me. More on reddit.com
๐ŸŒ r/learnpython
12
9
December 23, 2023
why can't I remove the last element of an array and reverse it this way?
You need to look at the syntax of slicing. It's list[start:stop:step]. So in your first one our start is 0, our stop is the last element and our step is backwards. So from element 0 we step backwards and we have our stop, done didn't encounter any elements so we have an empty list. More on reddit.com
๐ŸŒ r/learnpython
4
4
December 15, 2020
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-reverse-a-list-in-python-using-slicing
How To Reverse A List In Python Using Slicing - GeeksforGeeks
July 23, 2025 - 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.
๐ŸŒ
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.
๐ŸŒ
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:...
๐ŸŒ
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 ...
Find elsewhere
๐ŸŒ
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 - Summary: The slice notation list[::-1] with default start and stop indices and negative step size -1 reverses a given list. Problem: Given a list of elements. How to reverse the order of the elements in the list.
๐ŸŒ
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.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-reversing-list
Reversing a List in Python - GeeksforGeeks
This method builds a reversed version of the list using slicing with a negative step. ... Python's built-in reversed() function is another way to reverse the list.
Published ย  November 26, 2025
๐ŸŒ
Sololearn
sololearn.com โ€บ en โ€บ Discuss โ€บ 394526 โ€บ reverse-list-slice-likexyz-in-python
Reverse list slice (like[x:y:-z]) in Python | Sololearn: Learn to code for FREE!
Since the last one is 'e' and it's an element of an index 4, it gets printed and the command seeks another one to the left (you specified the step to negative 1). It goes to 'd' but it has an index of 3 and you set the boundary to 3. It does not get printed and the command ends. try2 prints out starting from the index 2 element ('c') and goes leftwards until it reaches the end of the slice (element index 0).
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ list-reverse-method
Python List reverse() Method: Syntax, Methods, and Examples
Learn how to reverse a list in Python using slicing, reverse(), reversed(), and loops. Compare methods, use cases, and performance best practices.
๐ŸŒ
Codecademy
codecademy.com โ€บ article โ€บ how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
To enhance your understanding of Python concepts and dive into more advanced topics, check out the Learn Intermediate Python 3 course from Codecademy. Yes! You can use slicing ([::-1]), reversed(), a for loop, or recursion to reverse a list ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-slicing-reverse-array-groups-given-size
Python Slicing | Reverse an array in groups of given size - GeeksforGeeks
April 13, 2023 - Finally, it concatenates all the chunks to form the final reversed array. 1. Initialize an empty list to store the final output 2. Iterate through the input list in steps of size k 3. For each step, slice the list from the current index to k elements ahead and reverse it 4.
๐ŸŒ
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.
๐ŸŒ
datagy
datagy.io โ€บ home โ€บ python posts โ€บ how to reverse a python list (6 ways)
How to Reverse a Python List (6 Ways) โ€ข datagy
February 15, 2023 - The function creates a slice object that allows us to easily reuse a slice across multiple objects. Because of this, we could apply the same indexing across different lists. Letโ€™s see how we can use the function in Python: # Reverse a Python list with slice() original_list = [1,2,3,4,5,6,7,8,9] reverser = slice(None, None, -1) reversed_list = original_list[reverser] print(reversed_list) # Returns: [9, 8, 7, 6, 5, 4, 3, 2, 1]
๐ŸŒ
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 to master Python list manipulation.
๐ŸŒ
Towards Data Science
towardsdatascience.com โ€บ home โ€บ latest โ€บ how to reverse python lists more efficiently
How To Reverse Python Lists More Efficiently | Towards Data Science
January 20, 2025 - We can reverse the list using slicing and a step size of 1. >>> my_lst_reversed = my_lst[::-1] >>> my_lst_reversed [80, 100, 40, 25, 30, 0, 10] ... It specifies a negative step size of 1, which means that the element are retrieved in the reversed order (from end to start) If you would like to understand more about slicing and indexing in Python, you can refer to one of my previous articles, here on Medium.