Back to Freecodecamp

Step 19

curriculum/challenges/english/blocks/learn-string-manipulation-by-building-a-cipher/65952b70924edb449faf1950.md

latest820 B
Original Source

--description--

Declare a new variable named shifted. Use the bracket notation to access the value of alphabet at index index and assign it to your new variable.

--hints--

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

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

You should assign alphabet[index] to your shifted variable.

js
assert.match(code, /^shifted\s*=\s*alphabet\s*\[\s*index\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'
index = alphabet.find(text[0].lower())
print(index)
--fcc-editable-region--