Back to Freecodecamp

Step 7

curriculum/challenges/english/blocks/workshop-caesar-cipher/680a82806c4c6bc3567f2708.md

latest815 B
Original Source

--description--

Declare a new variable named text and assign it the string hello world. This will be the message to encrypt.

--hints--

You should declare a variable named text.

js
({ test: () => assert(runPython(`_Node(_code).has_variable("text")`)) })

You should assign the string hello world to text. Remember to enclose the string in either single or double quotes and pay attention to the letter case.

js
({ test: () => assert(runPython(`_Node(_code).find_variable("text").is_equivalent("text = 'hello world'")`)) })

--seed--

--seed-contents--

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

--fcc-editable-region--