Back to Freecodecamp

Step 15

curriculum/challenges/english/blocks/learn-string-manipulation-by-building-a-cipher/655208d59b131e7816f18c96.md

latest973 B
Original Source

--description--

The print() function gives you only an output in the console, but functions and methods can have a return value that you can use in your code.

Now assign alphabet.find(text[0]) to a variable named index. In this way, index will store the value returned by alphabet.find(text[0]).

--hints--

You should declare a variable named index. Pay attention to place the variable name at the beginning of the line.

js
assert.match(code, /^index\s*=/m)

You should assign the value returned by alphabet.find(text[0]) to your index variable.

js
assert.match(code, /^index\s*=\s*alphabet\.find\s*\(\s*text\s*\[\s*\s*0\s*\]\s*\)\s*(#.*)?$/m)

Your code contains invalid syntax and/or invalid indentation.

js
({test: () => assert(true) })

--seed--

--seed-contents--

py
--fcc-editable-region--
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
alphabet.find(text[0])
--fcc-editable-region--