CertGrid CertGrid
Concepts·Certified Entry-Level Python Programmer

Python List Indexing and Slicing

Objective 3.1 is the largest part of PCEP's 25% collections block, and half of it is position arithmetic. Indexes run from 0 and from -1 backwards; slices take a start, a stop and a step, exclude the stop, and - unlike indexing - never raise however impossible the numbers are. Get those two rules straight and most of block 3 becomes mechanical.

Data Collections Guide 13 of 26 Beginner

Written against the versions above. Nothing here has changed in Python 3. Slicing and negative indexing work the same way on lists, tuples and strings, which is why this guide is the foundation for {{guide:tuples-and-immutability}} and {{guide:strings-the-basics}} as well.

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. Indexing from both ends

  2. Indexing out of range, in both directions

  3. Slicing

  4. A slice never raises

  5. Slices as targets: assignment and deletion

  6. Membership: in and not in

  7. Building a list

  8. What the exam does with this half of the objective

Official sources