Learn String Manipulation by Building a Cipher - Step 23

Tell us what’s happening: what am I missing here, I followed the instruction and put it before the for loop in the code

Describe your issue in detail here.

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(char)
print(index)
 for char in text:
    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/120.0.0.0 Safari/537.36 OPR/106.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 23

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

You are supposed to do that inside the loop. Remember that char (and any other variables) cannot be referenced before the declaration.

when I put the assigned index in the for loop it tells an error has occur with your code

please show your code

You should not modify the for loop condition. You need to write inside the loop body. Add what required to a new line before the print line.