DEV Community

Cover image for Range() Function in Python.
Keshav Jindal
Keshav Jindal

Posted on

Range() Function in Python.

1.Intoduction
The range function is used to return the sequence in number.
Syntax
range(start, stop, gap)
2.Parameters
-Start-It is a optional value. It specifies the range that where to start. Its default value is 0.

-Stop-It is a necessary step to specify the end point.

-Gap-it is a optional step to specify the incrementation. Its default increment value is 1.
Image description

For example-Image description
The output for above example is-
Image description
the starting point was not specified so, it started from default value.

NOTE
The float and String value cannot be accessed by range.
But an be accessed in sequence.
for example-Image description
output
Image description

3.Examples
1.Image description
output
Image description

  1. Image description output Image description

Top comments (0)