Previous Up Next

6.40.4  Making a list of integers: range

The range command creates lists of equally spaced numbers. It can take one, two or three arguments.

With one argument:


Example.
Input:

range(5)

Output:


0,1,2,3,4

With two or three arguments:


Examples.

You can use the range command to create a list of values f(k), where k is an integer satisfying a certain condition. (See Section 12.3.3 for the for loop used below.)


Previous Up Next