range() and xrange() take a third parameter that specifies a step. So you can do the following.

range(10, 0, -1)

Which gives

[10, 9, 8, 7, 6, 5, 4, 3, 2, 1] 

But for iteration, you should really be using xrange instead. So,

xrange(10, 0, -1)

Note for Python 3 users: There are no separate range and xrange functions in Python 3, there is just range, which follows the design of Python 2's xrange.

Answer from Chinmay Kanchi on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › backward-iteration-in-python
Backward iteration in Python - GeeksforGeeks
July 11, 2025 - We can use slicing slicing notation [::-1] to reverse the order of elements in an iterable. This works for lists, tuples, and strings, but not for sets or dictionaries (since they are unordered).
Discussions

Is there a way to reverse a for loop
The reversed() function might be what you're looking for. Return a reverse iterator. seq must be an object which has a __reversed__() method or supports the sequence protocol (the __len__() method and the __getitem__() method with integer arguments starting at 0). ie for i in reversed(range(1, 101)): print(i) output: 100 99 98 97 96 ... 5 4 3 2 1 More on reddit.com
🌐 r/learnpython
4
1
March 27, 2020
iterate over a string in reverse
https://docs.python.org/3/library/functions.html#reversed More on reddit.com
🌐 r/learnpython
7
1
February 7, 2023
Why isn't my loop iterating backwards in python?
Hint: Look up documentation on the ‘range’ function…does it actually do what you think it does given the two arguments you provided? Maybe you’re missing an argument? https://docs.python.org/3/library/stdtypes.html#range More on reddit.com
🌐 r/learnprogramming
13
0
March 8, 2023
Reversing a range using a FOR LOOP
You should show what you've tried so far. It's easier to give productive help if we base the help on code you've written. It doesn't require a for-loop though. You can use one, but it would be far more straightforward with a while. Be careful of artificially limiting what tools you consider. More on reddit.com
🌐 r/learnpython
11
0
December 24, 2022
🌐
Python Morsels
pythonmorsels.com › looping-in-reverse
Looping in reverse - Python Morsels
May 27, 2025 - To loop in the reverse direction, you can use Python's built-in reversed function: >>> colors = ["purple", "blue", "green", "pink", "red"] >>> for color in reversed(colors): ... print("I like", color) ...
🌐
Mimo
mimo.org › glossary › python › for-loop
Python For Loop: Syntax and Examples [Python Tutorial]
You can loop over a sequence in reverse order by using the reversed() Python function.
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python for loop in backwards
Python For Loop in Backwards - Spark By {Examples}
May 31, 2024 - Pass range() function into reversed() function will reverse the range() function without any modification and then iterate reversed() function using for loop. This syntax will return the values in backward direction i.e. from back side.
🌐
Codecademy
codecademy.com › article › how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
Learn how to reverse a list in Python using `.reverse()`, `reversed()`, slicing, the two-pointer method, loops, and recursion with examples.
Find elsewhere
🌐
Medium
medium.com › becoming-a-better-software-developer › undetstanding-python-iterators-reversed-iteration-35f1c1d16196
Undetstanding Python Iterators: Reversed Iteration | by Saleem Latif | Becoming a better Software Developer | Medium
March 8, 2023 - In Python, you can reverse iterate over a sequence by using the reversed() function. The reversed() function returns an iterator that produces the elements of a sequence in reverse order.
🌐
JanBask Training
janbasktraining.com › community › python-python › how-do-i-reverse-a-list-or-loop-over-it-backwards
How do I reverse a list or loop over it backwards? | JanBask Training Community
June 4, 2025 - Python offers built-in features that make this process clean and readable. ... The reversed() function returns an iterator that yields the elements of the list in reverse order. my_list = [1, 2, 3, 4, 5] for item in reversed(my_list): print(item)
🌐
TutorialsPoint
tutorialspoint.com › backward-iteration-in-python
Backward iteration in Python
August 7, 2019 - We use a for loop with an iterator ... gives us the following result − · Thu Wed Tue Mon · The reversed() function is very straight forward it's simply picks the elements and prints them in the reverse order....
🌐
Newtum
blog.newtum.com › reverse-a-number-in-python-using-for-loop
Reverse a Number in Python Using For Loop - Newtum
October 14, 2024 - The ‘for’ loop iterates through the length of the ‘num’ string in reverse order, starting from the last index and ending at the first index. In each iteration, the current character at the index is added to the ‘reverse’ variable using the ‘+=’ operator. Finally, the reversed string is printed as output: ‘654321’. Understand the Concept of Reverse a Number in Python Using While Loop, Here!
🌐
Real Python
realpython.com › python-range
Python range(): Represent Numerical Ranges – Real Python
November 24, 2024 - The range parameters start, stop, and step define where the sequence begins, ends, and the interval between numbers. Ranges can go backward in Python by using a negative step value and reversed by using reversed().
🌐
Replit
replit.com › home › discover › how to iterate backwards in python
How to iterate backwards in Python | Replit
1 month ago - The loop starts at 5 and is told to count down with a step of -1. Because the stop value 10 is already higher than the start, the sequence is empty from the beginning. The example below shows the correct approach. # Correctly specifying start > end for reverse iteration for i in range(10, 4, -1): print(i, end=' ') # Prints: 10 9 8 7 6 5
🌐
Real Python
realpython.com › python-reverse-list
Reverse Python Lists: Beyond .reverse() and reversed() – Real Python
June 28, 2023 - This diagram shows that you can access the first element of the list (or sequence) using either 0 or -5 with the indexing operator, like in sequence[0] and sequence[-5], respectively. You can use this Python feature to reverse the underlying sequence in place. For example, to reverse the list represented in the diagram, you can loop over the first half of the list and swap the element at index 0 with its mirror at index -1 in the first iteration.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-reversing-list
Reversing a List in Python - GeeksforGeeks
However, reversed() returns an iterator, so it needs to be converted back into a list. ... If we want to reverse a list manually, we can use a loop (for loop) to build a new reversed list.
Published   November 26, 2025