a = " ".join(str(i) for i in range(10, 0, -1))
print (a)
Answer from user225312 on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-for-loops
Python For Loops - GeeksforGeeks
Loop control statements change execution from their normal sequence. When execution leaves a scope, all automatic objects that were created in that scope are destroyed. Python supports the following control statements.
Published ย  1 month ago
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ backward-iteration-in-python
Backward iteration in Python - GeeksforGeeks
July 11, 2025 - Python ยท a = [1, 2, 3, 4, 5] #Loop through the List # reverse order using slicing(::-1) for item in a[::-1]: print(item) # same logic written using List comprehension # [print(item) for item in a[::-1]] Output ยท 5 4 3 2 1 ยท Using a while loop provides you control over the iteration process. This is need to manually control the index and decrement the index during each iteration to traverse the it backward.
Discussions

python - Decrementing for loops - Stack Overflow
I want to have a for loop like so: for counter in range(10,0): print counter, and the output should be 10 9 8 7 6 5 4 3 2 1 More on stackoverflow.com
๐ŸŒ stackoverflow.com
While loop with increment and decrement?
x += 0 and y -= 0 doesn't change the value of X and y so your while loop never terminates. Think about -1 * weekday. More on reddit.com
๐ŸŒ r/learnpython
13
5
April 11, 2017
Is there a way to change the value of range in a for loop?
It's hard to give feedback if you don't tell us what you want to do. More on reddit.com
๐ŸŒ r/learnpython
26
10
June 20, 2023
[Python] How do you increment/decrement values in a list?

x -= 1 conceptually means "create a new number object that has the value one less than x and make x refer to that object." This does not affect the list at all, because the list is still referring to the old object.

Use a list comprehension or iterate by index. See this thread from just the other day.

More on reddit.com
๐ŸŒ r/learnprogramming
4
5
October 30, 2012
๐ŸŒ
Invent with Python
inventwithpython.com โ€บ blog โ€บ pythons-fake-increment-and-decrement-operators.html
Python's Fake Increment and Decrement Operators - Invent with Python
May 21, 2018 - In Python, you can increase the value of a variable by 1 or reduce it by 1 using the augmented assignment operators. The code spam += 1 and spam -= 1 increments and decrements the numeric values in spam by 1, respectively. Other languages such ...
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ for-loop
Python For Loop: Syntax and Examples [Python Tutorial]
In this example, the loop iterates over the list of numbers with a starting value of 1. Each iteration assigns the current value from the sequence of numbers to number. The function call in the code block prints each number in the list. range() is a built-in function that creates a list of numbers starting at 0 and stopping before a specified integer. This makes the range function ideal for creating Python for loops with index variables.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ tutorial โ€บ controlflow.html
4. More Control Flow Tools โ€” Python 3.14.3 documentation
If the loop finishes without executing the break, the else clause executes. In a for loop, the else clause is executed after the loop finishes its final iteration, that is, if no break occurred.
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ loops-in-python
Loops in Python - GeeksforGeeks
For example, a for loop can be inside a while loop or vice versa. Loop control statements change execution from their normal sequence. When execution leaves a scope, all automatic objects that were created in that scope are destroyed. Python supports the following control statements.
Published ย  2 weeks ago
๐ŸŒ
Spark By {Examples}
sparkbyexamples.com โ€บ home โ€บ python โ€บ how to increment for loop in python
How to Increment For Loop in Python - Spark By {Examples}
May 31, 2024 - Python for loop is usually increment by 1 value however sometimes you would be required to increment 2, 3, 4 e.t.c. You can easily achieve this by using the range() function, with the range you can increment the for loop index with a positive ...
๐ŸŒ
TechBeamers
techbeamers.com โ€บ python-increment-and-decrement-operators
Python Increment and Decrement Operations - TechBeamers
November 30, 2025 - Python does not support x--, but a value can be reduced using the -= operator. x = 10 x -= 1 # Equivalent to x = x - 1 print(x) # Output: 9 ยท Similar to incrementing, decrementing can be applied using a step value:
๐ŸŒ
LearnPython.com
learnpython.com โ€บ blog โ€บ decrement-in-python-for-loop
How to Decrement a Python for Loop | LearnPython.com
August 22, 2022 - We can also set the step parameter to some other value (like -3) and the for loop will decrement by 3 instead of 1. Let's modify the previous example and output the results: >>> for i in range(9, -1, -3): ... print(i) ... 9 6 3 0 ยท We can also ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ decrement-in-while-loop-in-python
Decrement in While Loop in Python - GeeksforGeeks
July 23, 2025 - In the upcoming example, this would ... 0: # Displaying the value of n for that iteration print(n) # Decrementing the value by 1 n = n - 1 print("Loop Ends!")...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ how-to-decrement-a-python-for-loop
How to Decrement a Python for Loop - GeeksforGeeks
July 23, 2025 - The loop prints each value in descending order. In this example, the range(4, -1, -1) function generates a sequence starting from 4 and decrementing by 1 until reaching -1 (exclusive).
๐ŸŒ
Llego
llego.dev โ€บ home โ€บ blog โ€บ a comprehensive guide to increment and decrement operators in python
A Comprehensive Guide to Increment and Decrement Operators in Python - llego.dev
May 9, 2023 - To summarize, here are some key takeaways about increment and decrement operators in Python: Increment ++ and decrement -- operators provide a short-hand way to easily increment or decrement a variable by 1. Prefix vs postfix position impacts ...
๐ŸŒ
Python Pool
pythonpool.com โ€บ home โ€บ blog โ€บ 4 ways to decrement for loop in python
4 Ways to Decrement for loop in Python - Python Pool
January 3, 2024 - A For Loop is used to iterate over the sequence: a list, a tuple, a dictionary, a set, or a string. There is no decrement operator in Python.
๐ŸŒ
Java2Blog
java2blog.com โ€บ home โ€บ python โ€บ how to decrement for loop in python
Python for loop decrement - Java2Blog
October 28, 2021 - It can loop through different iterables also in Python. We need to decrement a for loop when we wish to execute something in reverse order. Python does not make use of the decrement operator in the for loop.
๐ŸŒ
Runestone Academy
runestone.academy โ€บ ns โ€บ books โ€บ published โ€บ fopp โ€บ SimplePythonData โ€บ UpdatingVariables.html
2.13. Updating Variables โ€” Foundations of Python Programming
If you try to update a variable ... x was initialized to 6. Updating a variable by adding something to it is called an increment; subtracting is called a decrement....
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ increment-and-decrement-operators-in-python
Increment and Decrement Operators in Python?
2 weeks ago - Python interprets ++ and -- as ... print("x *= 2:", x) x //= 4 # Floor division print("x //= 4:", x) ... Python uses += and -= for increment and decrement operations instead of ++ and --. This approach aligns with Python's ...
๐ŸŒ
Snakify
snakify.org โ€บ for loop with range
For loop with range - Learn Python 3 - Snakify
To iterate over a decreasing sequence, we can use an extended form of range() with three arguments - range(start_value, end_value, step). When omitted, the step is implicitly equal to 1. However, can be any non-zero value.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_for_loops.asp
Python For Loops
for loops cannot be empty, but if you for some reason have a for loop with no content, put in the pass statement to avoid getting an error. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com ยท If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com ยท HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial