Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python range in reverse order

# Basic syntax:
range(start, stop, -1) # or:
reversed(range(stop))
# Note, the stop value is not inclusive with range()

# Example usage:
for i in range(5, 0, -1):
    print(i)
# prints:
5
4
3
2
1
 
PREVIOUS NEXT
Tagged: #python #range #reverse #order
ADD COMMENT
Topic
Name
4+2 =