Day 12Caesar Cipher
Mediumstringsord-chr
Write caesar(text, shift) that moves every letter in text forward by shift places in the alphabet, wrapping from z back to a.
caesar("Hello, World!", 3) returns "Khoor, Zruog!".
Examples
Example 1
>>> caesar("Hello, World!", 3) "Khoor, Zruog!"
Example 2
>>> caesar("xyz", 2) "zab"
Good to know
- Keep capitals as capitals and lowercase as lowercase. Leave anything that is not a letter unchanged.
shiftcan be negative (to decrypt) or larger than 26.
Run examples checks the 2 examples above. Submit runs all 7 tests, including hidden edge cases, and marks the challenge solved.