range()
A lazy sequence of integers: range(stop), range(start, stop[, step]).
Beginner
list(range(5)) # [0, 1, 2, 3, 4]
list(range(10, 0, -3)) # [10, 7, 4, 1]
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.