The Python range() Function: Overview
Python’s built-inrange function is handy when you need to perform an action a specific number of times. As an experienced Pythonista, you’ve most likely used it before. But what does it do?
By the end of this course, you’ll:
- Understand how the Python
rangefunction works - Know how the implementations differ in Python 2 and Python 3
- Have seen a number of hands-on
range()examples - Be equipped to work around some of its limitations
Let’s get cracking!
00:00Hi! This is Austin Cepalia with realpython.com. In this course,we’re going to learn all about Python’s built-inrange() function.
00:10I like to think of built-in functions, likerange(), as some of the fundamentalbuilding blocks of Python programs.They make performing common tasks as simple as, well,calling a function! And because they are global functions,they are always available to us. By the end of this course,you’ll be comfortable using therange() function within your own Python programs.
00:37We’ll start by learning about the basics of therange() function and how we canuse it with definite iteration in the Pythonfor loop.
00:46We’ll learn about the three different implementations of therange() function,which will allow you to customize the output it generates. Finally,we’ll take a look at some advancedrange() topics,and I’ll warn you about some of its limitations. Let’s get started.
Course Contents

