Learn String Manipulation by Building a Cipher - Step 23

Problem: Sorry, your code does not pass. You’re getting there.

You should declare a new variable named index.

Here is my current code step 23, Python:

text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
index = alphabet.find(char)
for char in text:
print(char)


/* User Editable Region */


/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 23

Hi @urpalpaul ,

Take a look at your ordering :

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

Hi @urpalpaul ,

your Variable Initialization is very correct, the only problem is where you place it. you should place it after the for loop and before the print() function. Try this and it will work.

1 Like

thank you so much for your help!

2 Likes

thank you!! this helped a lot

1 Like