Function Details: range

Description


Returns an object that produces a sequence of integers from start to stop by step.


Extended Description


The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number. It's commonly used in for loops and for creating lists of numbers. range objects are immutable sequences and support most common sequence operations.


Read More about range from Python Documentation

Function Signature


range(start: int, stop: int, step: int = 1) -> range

Module: builtins

Class: range

Parameters



Parameter List


  • start: int
  • stop: int
  • step: int

Return


Returns a range object that represents an immutable sequence of numbers.


Return Type


range

Output

Explanation

These examples show basic usage of range() with different combinations of start, stop, and step values.