AI engineering glossary · Python core

What is range?

range: A built-in immutable sequence type representing an arithmetic progression of integers, created as range(stop), range(start, stop) or range(start, stop, step). It generates numbers lazily, so it uses little memory even for huge ranges. The stop value is excluded.

Level: beginnerTopic: Python core

range: an example

list(range(2, 10, 3)) gives [2, 5, 8], and for i in range(3) visits 0, 1, 2.

Related terms

More Python core terms

Where you learn it

range is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.