Python range() function

The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and ends at a specified number.

Syntax

       or

Parameter

start: It is an optional parameter that represents an integer number specifying at which position to start, and by default, its value is 0

stop: It is an optional value that represents an integer number specifying at which position to end.

step: It is an optional value that represents an integer number specifying the incrementation, and by default, its value is 1.

Return

This function returns a sequence of numbers, starting from 0.

Example 1

Output

Pin It on Pinterest

Share This