Learn String Manipulation by Building a Cipher - Step 26

Tell us what’s happening:

text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
for char in index:
index = alphabet.find(char)
print(char)
it tells me to declare the new variable before the “for” loop instead of above the “print(char)” like instructed. Did I miss a step?

Your code so far

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'

# User Editable Region

for char in index:
    index = alphabet.find(char)
    print(char)

# 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/130.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 26

Hi and welcome to our community!

This line appears to have been modified:

Otherwise, your code is correct. You may wish to hit the Reset button and resubmit your code. For this step you shouldn’t modify any of the existing lines of code, only add the variable declaration.

Happy to be here.
Thank you for your reply, I will try again.

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