Builtin Function: range
The built-in function range
returns a list of numbers in a range.
There are three ways to call this function:
The start
is inclusive, the end
is exclusive.
If start
is not provided, it defaults to 0
. If step
is not provided, it
defaults to 1
.
Negative steps are permitted and count down from start
towards end
, instead
of up.
The range ends when the next value given by the sum of the last value and step
would exceed end
, regardless of if it has been reached.
Impossible ranges, or ranges where start
will never reach end
given step
,
yield an empty list.
Supplying an undefined value to any argument of range
yields an undefined
value back.
A range with a zero step is a runtime error.