Real Python Tutorials

Python's range() Function
NEW

Python range(): Represent Numerical Ranges

Master the Python range() function and learn how it works under the hood. You most commonly use ranges in loops. In this tutorial, you'll learn how to iterate over ranges but also identify when there are better alternatives.

Jan 10, 2024 basics python