11.06
Completed
Python Tuples & Tuple Unpacking Python Tuples & Tuple Unpacking

Meet Python tuples: create fixed groups of values, read them by index, compare them with lists, and unpack them into clear variable names.

Python Tuples & Tuple Unpacking

Sounds useful?

Jump into the interactive version.

No setup. No account. Just Python.

Interactive Python lesson

Python Tuples & Tuple Unpacking

Tuples are ordered collections for values that belong together and are not expected to change. This Block introduces tuple syntax through practical fixed groups such as coordinates, dimensions, and named pairs.

You will learn how to create tuples, read items by index, check their length, and handle the important comma in a one-item tuple. You will also compare tuple immutability with mutable lists and see when each collection communicates your intention more clearly.

What you will learn

  • Create empty, one-item, and multi-item tuples
  • Read tuple values with positive and negative indexes
  • Use len() to inspect tuple size
  • Understand tuple immutability and how it differs from list mutation
  • Unpack fixed-size tuples into descriptive variable names
  • Recognize and fix mismatches between values and variable names
  • Use unpacking in loops and with dictionary items()

By the end, you will be able to choose tuples for stable groups of values and use unpacking to keep assignments and loops simple and readable.

> Start now 124 cards · about 12 min

Ready to practice this in the browser?

> Play now