Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

The Basics of range()

Give Feedback

In the previous lesson, you learned how to iterate or loop over a collection of data in the form of a list. That was great for your small list of names, but what if you want to generate a list of numbers? To do that, you can use the built-in range function.

There are three ways you can call range():

  1. range(stop) takes one argument.
  2. range(start, stop) takes two arguments.
  3. range(start, stop, step) takes three arguments.

Comments & Discussion

Become a Member to join the conversation.