Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

im stuck

Your code so far


/* User Editable Region */

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[0].lower())
print(index)
shifted = alphabet.find(alphabet[index + shift])
print(shifted)

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 16

you don’t need to use find again, you already have the index variable, and you can get a different index by shifting it. You just need to access the variable alphabet and get the letter three steps to the right of the one at index. If index is 0, that’s a, and moving three to the right (0 + 3) makes 3, which is d

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.