CertGrid CertGrid
Concepts·Certified Associate Python Programmer

Python ord(), chr() and String Operations

PCAP objective 3.2 is operate on strings, and its distinctive content is `ord` and `chr` - the two functions that turn a character into its code point and back. They are examined through arithmetic: shifting letters, converting case by adding 32, and the comparison order that falls out of the ranges. The classic exercise is a Caesar cipher, and this guide runs one.

Strings in Depth Guide 10 of 25 Intermediate

Written against the versions above. Nothing here has changed in Python 3. `chr()` accepts the full Unicode range up to 0x10FFFF; in Python 2 the equivalent function `unichr` was separate and narrower.

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. ord and chr are inverses

  2. The three ranges, and the gap between them

  3. How ord and chr refuse

  4. A Caesar shift, which is what this objective is for

  5. Case conversion is arithmetic

  6. The operators, on strings

  7. What the exam does with this objective

Official sources