Write a programElementary20 XPExercise 10/16

Caesar cipher

Task

The program reads a text and encrypts it with a Caesar cipher with a shift of 2: every letter of the English alphabet is replaced by the letter two places later (a → c, b → d, …). After the end of the alphabet it wraps around: y → a, z → b.

Upper-case letters stay upper-case (Z → B). All other characters - spaces, digits, punctuation and letters with diacritics - stay unchanged.

Examples

  • Input

    ahoj svet

    Expected output

    cjql uxgv

After you submit, 4 hidden tests will also check your solution: the end of the alphabet, upper case and punctuation, digits and a dot, letters with diacritics.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.