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?

Top answer
1 of 4
9
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.
2 of 4
1
no the empty placeholder sets the default that is meaningful for that position. One idiomatic use of this is mylist[:] that makes a copy. example: >>> a = [1,2,3,4] >>> b = a >>> b[2] = 6 # oops, b references a, so this modifies a >>> a [1, 2, 6, 4] >>> b = a[:] # make a copy >>> b[0] = 1 >>> a [1, 2, 6, 4] # didn't change >>> b [1, 2, 6, 4] incidentally, a[::] also works, it's taking the default step of 1
reversed vs [::-1] Jun 24, 2014
r/Python
12y ago
Why is list.reverse() an O(n) operation? Apr 7, 2022
r/learnpython
4y ago
Python slicing, a[len(a)-1:-1:-1] May 9, 2025
r/learnpython
last yr.
List slicing with negative index Dec 15, 2021
r/learnpython
4y ago
More results from reddit.com
Discussions

Python reversing slice of a list - Stack Overflow
How do I reversed or iterate a list using its index? Here is an example lst = [3,2,4,1,5] Output would be: [3,2,4,5,1] (index 3 which is 1 is place in the end) Another example: lst = [1,5,4,2,3] More on stackoverflow.com
🌐 stackoverflow.com
April 14, 2012
Advanced slicing rules?
So I’m taking a quiz and the first question asks something that was never written or spoken once in the section on lists as they pertain to slicing… which is absolutely infuriating as I am someone who tries to understand EVERYTHING before moving on: Question 1: What are the values of list_b ... More on discuss.python.org
🌐 discuss.python.org
19
1
August 14, 2022
Beginner question: assigning variable to list.reverse()
Any idea why assigning variable Y to this does not result in anything · Yes. To avoid an accident where you think you have a new, separate, list there is a convention in Python that a function which changes something in place returns None so that you can’t proceed thinking you have a new thing. More on discuss.python.org
🌐 discuss.python.org
10
0
May 12, 2022
Hopelessly stuck on this challenge - slice of a list with all even indexes in reverse
However, it doesn't work when the slice starts at -2 either. Python Web Development Techdegree Graduate 16,731 Points ... UPDATE 2: Okay, clearly there is something about the whole 'number of indexes' thing that was confusing to me because I had this backwards - this ended up working: def reverse_evens(item): if len(list... More on teamtreehouse.com
🌐 teamtreehouse.com
3
March 16, 2017
🌐
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.
🌐
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:...
🌐
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.
🌐
Mimo
mimo.org › glossary › python › list-reverse-method
Python List reverse() Method: Syntax, Methods, and Examples
This built-in tool is part of how Python efficiently walks through a list backward. The underlying name comes from the behavior of a built-in reversed mechanism, which is powered by a built-in function.
🌐
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   May 29, 2026
Find elsewhere
🌐
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 ...
🌐
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.
🌐
Flexiple
flexiple.com › python › reversing-list-python
Reversing A List In Python - Flexiple
March 18, 2024 - 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 ...
🌐
Sololearn
sololearn.com › en › Discuss › 394526 › reverse-list-slice-likexyz-in-python
Reverse list slice (like[x:y:-z]) in Python
May 16, 2017 - Sololearn is the world's largest community of people learning to code. With over 25 programming courses, choose from thousands of topics to learn how to code, brush up your programming knowledge, upskill your technical ability, or stay informed about the latest trends.
🌐
Replit
replit.com › home › discover › how to reverse a list in python
How to reverse a list in Python | Replit
February 5, 2026 - Slicing with a negative step is a concise way to create a reversed copy of a list. The magic happens in the [::-1] notation, which is a specific use of Python's extended slice syntax, [start:stop:step]. This approach is handy because it returns ...
🌐
Real Python
realpython.com › reverse-string-python
Reverse Strings in Python: reversed(), Slicing, and More – Real Python
July 31, 2023 - Passing None to the first two arguments of slice() tells the function that you want to rely on its internal default behavior, which is the same as a standard slicing with no values for start and stop. In other words, passing None to start and stop means that you want a slice from the left end to the right end of the underlying sequence. ... The second and arguably the most Pythonic approach to reversing strings is to use reversed() along with str.join().
🌐
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.
🌐
Medium
geekpython.medium.com › 8-ways-to-reverse-the-elements-in-a-python-list-ad50889bdd7e
8 Ways To Reverse The Elements In A Python List | by Sachin Pal | Medium
November 25, 2022 - The above code will step over the elements from the original list in reverse order. ... Python has a function called slice() that returns a slice object which is used to specify how to slice a sequence. It takes 3 arguments (start, stop, step).
🌐
Python.org
discuss.python.org › python help
Advanced slicing rules? - Python Help - Discussions on Python.org
August 14, 2022 - So I’m taking a quiz and the first question asks something that was never written or spoken once in the section on lists as they pertain to slicing… which is absolutely infuriating as I am someone who tries to understand EVERYTHING before moving on: Question 1: What are the values of list_b and list_c after the following snippet? list_a = [1, 2, 3] list_b = list_a[-2:-1] list_c = list_a[-1:-2] To me this answer would be: list_b = [2,3] list_c = [3,2] … but that is not one of the answer...
🌐
Python.org
discuss.python.org › python help
Beginner question: assigning variable to list.reverse() - Python Help - Discussions on Python.org
May 12, 2022 - Any idea why assigning variable Y to this does not result in anything? create a list of prime numbers x = [2, 3, 5, 7] reverse the order of list elements y=x.reverse() print(y)
🌐
Quora
quora.com › Why-does-my_list-1-reverse-a-list-in-python-Can-someone-explain-to-me-the-syntax
Why does my_list [::-1] reverse a list in python? Can someone explain to me the syntax? - Quora
Freelance Python and Learn to Code Instructor · Author has 2.1K answers and 8.9M answer views · 7y · Let’s be pedantic. I’m a teacher, I can’t help it. my_list[::-1] does not reverse a list. It generates a new slice of the original list, which happens to contain the elements in reverse ...