Back to Freecodecamp

Step 9

curriculum/challenges/english/blocks/workshop-caesar-cipher/6810869355fa2468f9ebaf9c.md

latest559 B
Original Source

--description--

Now print encrypted_text to see the output in the terminal.

--hints--

You should print encrypted_text.

js
({ test: () => assert(runPython(`_Node(_code).has_call("print(encrypted_text)")`)) })

--seed--

--seed-contents--

py
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[shift:] + alphabet[:shift]
translation_table = str.maketrans(alphabet, shifted_alphabet)
text = 'hello world'
encrypted_text = text.translate(translation_table)
--fcc-editable-region--

--fcc-editable-region--