Back to Freecodecamp

Step 18

curriculum/challenges/english/blocks/learn-string-manipulation-by-building-a-cipher/65520e6f2b9678799977f24d.md

latest1.1 KB
Original Source

--description--

Remove the last print() call. Then, instead of text[0], pass text[0].lower() as the argument to your .find() call and see the output.

--hints--

You should not have print(text.lower()) in your code.

js
const commentless_code = __helpers.python.removeComments(code);
assert.notMatch(commentless_code, /print\s*\(\s*text\.lower\s*\(\s*\)\s*\)/);

You should still print your index variable.

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

You should update your alphabet.find(text[0]) call to use text[0].lower() as the argument. Pay attention to place the method call at the beginning of the line.

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