range()

Returns a sequence of numbers. Commonly used in for loops.

Syntax

python
range(stop)
range(start, stop, step)

Example

python
for i in range(5):
    print(i)  # 0, 1, 2, 3, 4

list(range(0, 10, 2))  # [0, 2, 4, 6, 8]