CertGrid CertGrid
Concepts·Certified Entry-Level Python Programmer

Python Tuples and Immutability

Objective 3.2 is short because a tuple is a list you cannot change - the indexing and slicing from the previous guides applies unaltered. What is worth the time is everything around that: `(1)` is not a tuple and `1,` is, immutability does not reach inside the items, and the reason a tuple can be a dictionary key while a list cannot is the single idea the whole objective is built on.

Data Collections Guide 15 of 26 Beginner

Written against the versions above. Unchanged in Python 3. Starred unpacking - `first, *rest = t` - arrived in Python 3.0 and is not on the PCEP syllabus, but it is shown here because it appears in real code and in some practice questions.

One machine, and any shell with Python 3 will do - these exams test the language, not a distribution.
Server NameIP AddressOSRolesCPURAMHDD
RUNNER01192.168.0.27Ubuntu 26.04 LTSPython 3.14.4 - the only machine this path needs2 Core4 GB50 GB

Before you start

  1. Everything a list can do, minus changing

  2. The comma makes the tuple, not the brackets

  3. Three ways a tuple refuses, three different exceptions

  4. Immutable does not reach inside the items

  5. A tuple has exactly two methods

  6. Unpacking, and the swap it makes possible

  7. When unpacking does not fit

  8. Why a tuple can be a dictionary key

  9. What the exam does with this objective

Official sources