The Python Language 2

Explore mutable and immutable sequences in Python.

Tuples and ranges

In the previous lesson, we introduced str, which is an immutable sequence type for storing and manipulating strings. Other immutable sequence types are tuple and range. Tuples can be used for storing sequences of any type, and ranges store contiguous sequences of int.

Get hands-on with 1200+ tech skills courses.