🔐
Secret code
Encode a message by shifting every letter — the Caesar cipher.
Builder· ages 10–1225 minforord / chrstring methodsmodulo
cipher.py
…First load pulls ~10 MB of Python. Only happens once — the browser caches it after.
What should the output look like?
You should see the original message and its encoded version printed.
📖
How this works
The Caesar cipher shifts every letter along the alphabet by a fixed number. Named after Julius Caesar, who used it 2000 years ago. ord() turns a letter into a number, chr() turns it back.
Your turn — try these
- 1Write the DECODE version (negative shift) to reverse it.
- 2Try shift=13 — that's the famous ROT13 cipher used all over the internet.
- 3Preserve capital letters exactly — 'Hello' should encode to 'Khoor'.