An immutable sequence of integers created with range(). You can reuse it without creating a full list; use list() when you need a list.
Syntax
range(stop, /) | range(start, stop, step=1, /)Constructor parameters
| Name | Description |
|---|---|
startInt | Start value (inclusive) Depends on overload · Positional only Default: 0 |
stopInt | End value (exclusive) Required · Positional only No default |
stepInt | Difference between consecutive values. Use a negative value to count down; 0 raises an error. Depends on overload · Positional only Default: 1 |
Returns
Example
numbers = range(0, 10, 2)
text(str(list(numbers)))
text(str(numbers.index(4)))Fields
| Name | Description |
|---|---|
startInt | Inclusive starting boundary. |
stopInt | End boundary, excluded from the sequence. |
stepInt | Difference between consecutive values. |
Field example
numbers = range(2, 10, 2)
text(str(numbers.start))