Learn String Manipulation by Building a Cipher - Step 23

Tell us what’s happening:

I’m not understanding what the problem is asking here. How do we declare a new variable name? I know how to initialize it with index = “sample”, am I adding this declaration to the print(char + index)?

I need help please so I can move forward

Your code so far

text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
index =

for char in text:
print(char)


/* User Editable Region */

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 23

in Python initializing and declaring a variable are the same, as there is no specific way to denote a new variable

Before printing the current character, declare a variable called index and assign the value returned by alphabet.find(char) to this variable.

Do not leave the index = hanging like that, if you don’t write anything after the =, it’s a syntax error, so maybe delete that line, and then think, where do you print the current character? create a new line before that, and give the value to the variable there

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