CertGrid CertGrid
Concepts·Certified Entry-Level Python Programmer

Python Dictionaries

Objective 3.3 covers dictionaries: a mapping from keys to values, where the keys must be hashable and the values need not be. Two facts in circulation are out of date - dictionaries have kept insertion order since Python 3.7, and `has_key()` has not existed since Python 2. The rest is a small method list plus one genuinely surprising result about which keys count as the same key.

Data Collections Guide 16 of 26 Beginner

Written against the versions above. **Insertion order has been guaranteed since Python 3.7** and was already true as an implementation detail in 3.6. Any material describing dictionaries as unordered, or using `d.has_key(k)`, is Python 2 or pre-3.7 and should be distrusted generally - see {{guide:python-314-versus-the-syllabus}}.

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. The four operations

  2. A key that is not there

  3. The three views

  4. Order, and what counts as the same key

  5. The methods that change a dictionary

  6. Other ways to build one

  7. What the exam does with this objective

Official sources