Title: Range Function
Course: CPS 120: Introduction to Computer Science ~ Master (Aug/2015) OLD > Section: Learning Units

Python Range function:

- Is one of many built-in functions provided by Python.
- Is used to generate a set of numbers.
- Range function syntax:

Range ([start], [end], [step])

Where
[start], [end], and [step] are integers
[start] is optional; defaults to 0 if not specified
Range is up to but not including [end]
[step] is optional; defaults to 1 if not specified

- Range function examples:

range(5) produces set [0,1,2,3,4]
range(1, 7) produces set [1,2,3,4,5,6]
range(0, 20, 4) produces set [0,4,8,12,16]
range(5, -1, -1) produces set [5,4,3,2,1,0]