Name

range()

Examples
for i in range(5):
    print(range(i)) 

'''
The above prints:

[]
[0]
[0, 1]
[0, 1, 2]
[0, 1, 2, 3]
'''
Description Range() generates lists containing arithmetic progressions. It is useful when you need to iterate over a sequence of numbers. The end point is never part of the generated list, i.e. the list generate by range(5) will not include 5. It is possible to let range start at another number, or to specify another increment.
Syntax
range(end)
range(start, end)
range(start, end, increment)
Parameters
start start point of the generated list
end end point of the generated list
increment value to increment by
Updated on Tue Jul 11 06:52:24 2017.
Creative Commons License