Top index Wirbel home

::range

range(upto) - create list of integers from 0 to upto-1
range(from, upto) - create list of integers from from to upto-1

range(upto) creates a new list of integers beginning at 0 and ending at upto-1. Note that using ranges in order to build loops over a range of integers is not very fast. Use a construction with while instead, if speed matters.

range(from, upto) creates a new list of integers beginning at from and ending at upto-1. Then length of the list is thus upto - from

Examples

 range(5) == [ 0, 1, 2, 3, 4]

 range(5,10) == [ 5, 6, 7, 8, 9 ]