DEV Community

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

Posted on

3 2

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

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay