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 - s = "Python" # - len(s) - 1: Start ... i in range(len(s) - 1, -1, -1): print(s[i]) Output · n o h t y P · We can use slicing slicing notation [::-1] to reverse the order of elements in an iterable....
Discussions

python - Loop backwards using indices - Stack Overflow
Using a reversed generator would take milliseconds and only use up a few bytes of memory. 2019-09-29T06:23:02.01Z+00:00 ... the third parameter (step) is by default +1. So you have to specify 3rd parameter to range() as -1 to step backwards. ... NOTE: This includes 100 & 0 in the output. There are multiple ways. ... For pythonic ... More on stackoverflow.com
🌐 stackoverflow.com
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
How to Loop Backwards in Python? - TestMu AI Community
How can I loop backwards from 100 to 0 in Python using a backwards range python? I tried using for i in range(100, 0), but it doesn’t work as expected. How can I fix this to achieve a backward loop? More on community.testmu.ai
🌐 community.testmu.ai
0
December 8, 2024
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
🌐
LearnPython.com
learnpython.com › blog › reverse-range-in-python
How to Reverse a Range in Python | LearnPython.com
September 7, 2022 - In the example below, we jump downwards ... # 80 # ... As a bonus, here’s another way to reverse a range: use the sorted() function with the parameter reverse=True....
🌐
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().
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python for loop in backwards
Python For Loop in Backwards - Spark By {Examples}
May 31, 2024 - Usually loop iterations start from ... function. Pass range() function into reversed() function will reverse the range() function without any modification and then iterate reversed() function using for loop....
Find elsewhere
🌐
Python Morsels
pythonmorsels.com › looping-in-reverse
Looping in reverse - Python Morsels
May 27, 2025 - If you're working with a list, a string, or any other sequence in Python, you can reverse that sequence using Python's slicing syntax: >>> colors = ["purple", "blue", "green", "pink", "red"] >>> colors[::-1] ['red', 'pink', 'green', 'blue', 'purple'] The syntax looks weird, but it does work. If we wanted to write a for loop that iterated over our list from the end to the beginning, we could loop over the reversed slice of that list:
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › reverse a range in python with examples
Reverse a Range in Python with Examples - Spark By {Examples}
May 31, 2024 - In this article, you have learned how to reverse the range in Python by using the built-in functions reversed() and sorted(). Besides these, you can also print the range in reverse order by using for loop.
🌐
GoLinuxCloud
golinuxcloud.com › home › python › how to print range() in reverse order in python
How to print range() in reverse order in Python | GoLinuxCloud
December 29, 2023 - # Python range reverse with three arguments in reverse order myRange = range(20, 0, -1) # printing print("The Range in reverse order is :") # for loop to iterate for num in myRange: # condition if (num%4==0): print(num) ...
🌐
Flexiple
flexiple.com › python › python-range-reverse
How to reverse a range in Python? | Flexiple Tutorials | Python - Flexiple
March 14, 2022 - Increment - Optional, used to specify the incrementation. #if only one argument is passed, Python assumes that it is a stop value. for i in range(5): print(i) ... It is common to reverse a list of values in the range.
🌐
Enterprise DNA
blog.enterprisedna.co › how-to-reverse-a-range-in-python
5 Way How to Reverse a Range in Python: A Step-By-Step Guide – Master Data Skills + AI
For example, you can iterate over ... summary, to reverse a range in Python, you need to convert it to a list, use the reversed() function on the list, and then convert the resulting reverse iterator back to a list if needed....
🌐
TestMu AI Community
community.testmu.ai › ask a question
How to Loop Backwards in Python? - TestMu AI Community
December 8, 2024 - How can I loop backwards from 100 to 0 in Python using a backwards range python? I tried using for i in range(100, 0), but it doesn’t work as expected. How can I fix this to achieve a backward loop?
🌐
Delft Stack
delftstack.com › home › howto › python › python backward range
How to Get Range Backwards in Python | Delft Stack
March 4, 2025 - This tutorial demonstrates how to iterate backwards using the range method in Python. Learn various techniques including using the range function with a negative step, the reversed function, and list slicing. Each method is explained with clear code examples, making it easy to understand how to effectively traverse iterables in reverse order.
🌐
PYnative
pynative.com › home › python › python range() explained with examples
Python range() Function Explained with Examples
March 17, 2022 - Let’s see how to loop in a reverse iteration or backward iteration to display a range of numbers from 5 to 0. # reverse range using negative step # start = 5 # stop = -1 # step = -1 for i in range(5, -1, -1): print(i)Code language: Python (python) Run
🌐
Freak Learn
freaklearn.com › home › how can you use a for loop in reverse in python?
How Can You Use a For Loop in Reverse in Python?
May 11, 2025 - To loop in reverse, you can set the `start` parameter to a higher value than `end`, and use a negative `step`. For example, to iterate from 10 down to 1, you can use: “`python for i in range(10, 0, -1): print(i) “`
🌐
Kodeclik
kodeclik.com › python-range-in-reverse
How to Reverse a Range in Python
September 19, 2024 - There are three ways to reverse a range in Python. 1. Use a negative step size to construct the range. 2. Use the reversed() function. 3. Construct the range the normal way and then use slicing.
🌐
DEV Community
dev.to › lavary › how-to-reverse-a-range-in-python-with-examples-664
How to reverse a range in Python (with examples) - DEV Community
February 4, 2023 - The reversed() function takes a ... reversed-iterator object. You can use reversed() function in conjunction with the range() function in for loops to iterate over a sequence in reverse order:...
🌐
CodeRivers
coderivers.org › blog › python-for-i-in-range-reverse
Python's `for i in range` in Reverse: A Comprehensive Guide - CodeRivers
March 25, 2025 - When dealing with numeric sequences, reversing the iteration can be useful for calculations. For example, calculating the sum of numbers from 1 to 10 in reverse: sum_value = 0 for i in range(10, 0, -1): sum_value += i print(sum_value)