Count
Syntax
count($start, $stop)
count($start, $stop, $step)
Description
Generates a list of numbers from start
(inclusive) to stop
(exclusive). If the optional argument step
is specified, this determines the increment between the numbers in the list.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
start | Number | The start value of the count. The number is included in the list. | yes | |
stop | Number | The final value of the count. The number will not be included in the list. | yes | |
step | Number | The increment with which to increment. Only integers are allowed, and these can also be negative. | no | 1 |
Return value
Type: Set
A list containing all numbers in the count.
Examples
Count without increment
count(0, 10)
Output: A list with the elements [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].
Count with increment
count(0, 10, 2)
Output: A list with the elements [0, 2, 4, 6, 8].
Count with negative increment
count(10, 0, -2)
Output: A list with the elements [10, 8, 6, 4, 2].
Invalid count
count(10, 0)
Output: Creates an empty list.