Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways

Range() in Python | Python for Data Science | Day 16

We hope you are putting your time to a productive The Data Monk is back with a new tutorial for you. 
The range() in Python function is used to return a sequence of numbers within the specified numbers. Let’s discuss range() in Python function in detail.

The range() function has three parameters: start, stop and step. 

For instance, if we mention just one parameter, it is considered as the stop point.

Range() in Python

Actually, the loop runs for N-1 times if N is the stop point. 

We can also specify the initial and stopping point. 

Range() in Python

Let’s check out another instance where we also mention the step size. Here, the numbers are printed from 1 to N-1 i.e 1 to 29, at the step size of 3.

Out of the three parameters, i.e. start, stop and step, the required parameter is stop. By default, the start parameter has default value 0 and the default step parameter is 1. 

You can also use this:

Here, we have used the length of list as the stop parameter. 

Alright! Time to practice some questions. We have answered them for you. If you are stuck, don’t hesitate to seek help.

We have covered 40+ complete Data Science company interviews from the candidates who cracked these interviews.
Data Science Companies interview questions
We also have 30+ e-books on Amazon, Insta Mojo and books which can be delivered directly on your email address
Complete Set of e-books from The Data Monk
Understand some of the very complex topics in Analytics which are asked in most of the interviews
The Data Monk Top Articles
How to become a Data Scientist? Complete study material, free resources and websites to practice
Become a Data Scientist 
Make your profile on our website and practice at least 5-7 questions per day. Be a part of ~2000 Analytics expert

Article By,
Yashika Khurana
Intern | The Data Monk

About TheDataMonkGrand Master

I am the Co-Founder of The Data Monk. I have a total of 6+ years of analytics experience 3+ years at Mu Sigma 2 years at OYO 1 year and counting at The Data Monk I am an active trader and a logically sarcastic idiot :)

Follow Me

Leave a reply