The idea of range is easy to grasp: make a regular sequence of numbers. Each number in the sequence is some constant larger or smaller than the previous number. Examples of desired sequences are

```
(0,1,2,3,4,5,6,7,8,9,10,11,12)
(-10,-6,-2,2,6,10,14,18)
(205,204,203,202,201,200,199)
```

The parameters of range are straightforward:
`range(start,end,increment)`

. The
official documentation
might show the parameters differently, which seems
confusing initially:

```
range([start],stop,[step])
```

The confusing thing is the addition of square brackets. In official documents of Python, square brackets surrounding a parameter indicate that it can be omitted. Thus,

```
range(stop)
range(start,stop)
range(start,stop,step)
```

are the three valid ways to use range. The thinking
behind this convention is that, based on experience
of programmers, the most frequent range usage is
to get a sequence `[0,1,2 ... p]`

for
some positive number p. In fact, most often one
sees something like

1 2 3 | ```
>>> R = [267,'j',0,1.57,33,-9]
>>> range(len(R))
[0, 1, 2, 3, 4, 5]
``` |

The example just produces a list of numbers so that each can be used to index the sequence R. It is not so convenient to get the same sequence backwards:

1 2 3 | ```
>>> R = [267,'j',0,1.57,33,-9]
>>> range(len(R)-1,-1,-1)
[5, 4, 3, 2, 1, 0]
``` |

Somewhat more often, programs need a sequence of numbers going through part of a full range, for instance

1 2 3 | ```
>>> R = [267,'j',0,1.57,33,-9]
>>> range(3,len(R))
[3, 4, 5]
``` |

(showing that the default step value is 1).

So, to remember the parameters of range, learn what
ways of using range happen most frequently in software:
`range(m)`

for getting the numbers 0 through
m-1, `range(k,m)`

for getting numbers k
through m-1, and the least frequent case with all
parameters,

1 2 | ```
>>> range(31,100,10)
[31, 41, 51, 61, 71, 81, 91]
``` |