← ACARA Digital Technologies Years 7–8

Wrapping around from Z to A

When a shift goes past Z, the count carries on from A, so X shifted by 3 becomes A. The alphabet works like a circle of 26 letters, numbered 0 to 25.

Understanding Wrapping around from Z to A in ACARA Digital Technologies Years 7–8

What it does: Going one step past Z (25) gives 26, which is the same position as A (0) on the circle. Subtracting 26 takes you once around the circle and lands on the correct letter number between 0 and 25. X moves to Y, then Z, then wraps around to A. The count carries on from A after Z. A is 0, so the 26th letter, Z, is number 25. There is no letter 26. The count wraps back to 0, which is A. The letter after Z is A in the circular alphabet, so the shift carries on. The broken code forgets to wrap. Subtracting 26 gives 0, so X shifted by 3 is A.

Common mistakes: The alphabet has 26 letters, numbered 0 to 25, so the wrap-around size must be 26, not 25. With 25, X shifted by 3 would not come out as A. The remainder must use 26 because the circular alphabet has 26 letters. The line should be new = (num + shift) % 26, which gives 0 (A) for X shifted by 3.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 674–695) and word search (Modules 635–695).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A Caesar cipher uses a shift of 3. What does the letter X become?
DA
Matches
X (23) shifted by 3 = 26, so the letter is 26
↓
There is no letter 26. The numbers only go from 0 to 25, so 26 must wrap around to 0, which is A.
Applying
Meanings
Term
wrap around
Meaning
When a shift goes past Z, the count carries on from A, so X shifted by 3 becomes A. The alphabet works like a circle of 26 letters, numbered 0 to 25.
Practice
position ← 23
Testing
Gaps
newPos ← (pos + shift) 26
Check Answer
Spots
1letters = 25
2x = 23

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Parrotfish' badge — Function Builder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A Caesar cipher uses a shift of 3. What does the letter X become?
A. A ✓
B. D
X moves to Y, then Z, then wraps around to A. The count carries on from A after Z.
2. The letters are numbered 0 to 25. Which number is Z?
A. 25 ✓
B. 26
A is 0, so the 26th letter, Z, is number 25.
3. Which describes the alphabet in a Caesar cipher shift?
A. A straight line that stops at Z
B. A circle of 26 letters ✓
After Z the shift carries on from A, so the alphabet works like a circle.
4. Shift Y by 3. What letter do you get?
A. B ✓
B. C
Y moves to Z (1), then A (2), then B (3). Count past Z and carry on from A.
5. X is number 23. Shifting by 3 gives 26, which is past the end of 0 to 25. What happens next?
A. It stays as 26 and becomes a new letter
B. It wraps around to 0, which is A ✓
There is no letter 26. The count wraps back to 0, which is A.

Match the Pairs

(23 + 3) mod 26 = 0 → X is number 23. Shifting it by 3 reaches 26, which wraps back to 0, the letter A.
(25 + 2) mod 26 = 1 → Z is number 25. Shifting it by 2 wraps around to 1, which is the letter B.
The alphabet is a circle of 26 letters numbered 0 to 25, so the number after 25 goes back to 0 → 25 + 1 = 26, then 26 - 26 = 0
To count past Z, subtract 26 whenever the total is bigger than 25 → if total > 25: total = total - 26
X (23) shifted by 3 = 26, so the letter is 26 → There is no letter 26. The numbers only go from 0 to 25, so 26 must wrap around to 0, which is A.
Z (25) + 2 = 27, then 27 - 26 = 2, so the letter is C → The sum is wrong. 27 - 26 is 1, not 2, and letter 1 is B, so Z shifted by 2 is B.

Key Term

wrap around
When a shift goes past Z, the count carries on from A, so X shifted by 3 becomes A. The alphabet works like a circle of 26 letters, numbered 0 to 25.

Fill in the Blanks

1. newPos ← (pos + shift) MOD 26
Hint: Type the operator that gives the remainder after dividing, which makes the count wrap back to the start.
2. newPos ← (pos + shift) MOD 26
Hint: Type the number of letters in the alphabet, which is the point where the count wraps around.
3. A ← 0 Z ← 25
Hint: Type the number given to Z when letters are numbered from 0.
4. IF pos > 25 THEN pos ← pos - 26 END IF
Hint: Type the comparison operator that checks whether the count has gone past Z.
5. (23 + 3) MOD 26 gives 0, which is A
Hint: Type the number for the letter X when A is 0, B is 1 and so on.

Spot the Error

Question 1
A letters = 25
B x = 23
C shift = 3
D new = (x + shift) % letters
Line A — The alphabet has 26 letters, numbered 0 to 25, so the wrap-around size must be 26, not 25. With 25, X shifted by 3 would not come out as A.
Question 2
A num = 23
B shift = 3
C new = (num + shift) % 25
D print(new)
Line C — The remainder must use 26 because the circular alphabet has 26 letters. The line should be new = (num + shift) % 26, which gives 0 (A) for X shifted by 3.
Question 3
A # A=0, B=1, ... Z=25
B num = ord(ch) - 65
C new = (num + 3) / 26
D print(chr(new + 65))
Line C — Wrapping needs the remainder operator %, not division. Division gives a fraction and never carries the count on from A. It should be new = (num + 3) % 26.
Question 4
A num = 25
B shift = 1
C total = num + shift
D new = total // 26
Line D — // gives how many times 26 fits, which is 1 here, not the wrapped position. Use % to get the remainder: 26 % 26 = 0, which is A.
Question 5
A # A=1, B=2, C=3 ... Z=26
B z = 25
C new = (z + 1) % 26
D print(new) # 0 is A
Line A — The letters are numbered 0 to 25, so A is 0 and Z is 25. The rest of the program uses 25 for Z and 0 for A.

Student with a class code? Join your class →