Python – Find Sequence Integers (Start – Stop) – range() Function with Examples

range() function is used to find the an immutable sequence object of integers between the given start integer to the stop integer in Python for the given input.

range() function is a part of Python Built-in Functions.

Syntax of range() Function

The syntax of range() function in Python is:

range(stop) range(start, stop[, step])

 

Parameters of range() Function in Python

x – Where x is any valid . This parameter is required.

 

Compatibility

range() function is available and compatible with both Python 2.x and 3.x.

 

Return Value of range() Function in Python

range() function returns an immutable sequence object of integers between the given start integer to the stop integer for the given input.

 

Python range() Function Example 1

Example CODE

Output:

 

Python range() Function Example 2

Example CODE

Output: