Python's range() function
Briefly

The range function in Python allows for easy counting, accepting up to three parameters: start, stop, and an optional step value, facilitating both upward and downward counting.
When utilizing the range function with a step value, the default is 1. For instance, 'range(0, 51, 10)' counts from 0 to just before 51 in increments of 10.
To count backwards in Python, providing a negative step value in the range function enables counting down from a larger to a smaller number.
The arguments accepted by the range function (start, stop, step) are analogous to slicing a sequence in Python, effectively defining how to traverse the collection.
Read at Pythonmorsels
[
|
]