Learn String Manipulation by Building a Cipher - Step 24

Tell us what’s happening:

hello everyone , i was confused in this part of step 24 what do i have to do with print(i) do i have to write for print(i) in text: or print(i) then for i in text: or a different line

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for i in text:


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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 24

This for loop will iterate over each letter in the text string in turn, so the value of i will change with each iteration of the loop. You can simply use a print command to print i and your for loop will print the text string letter by letter.

so im supposed to just write print(i)?

Why don’t you try it and see what happens?

because ive tried different things for like 40 mins stright
i cant get it

it tells me to Your code has an indentation error. You may need to add pass on a new line to form a valid block of code.

i did and doesnt work

If you have an indentation error it suggests that the code inside your for loop is not indented four spaces. Either that or you have other code indented which shouldn’t be.

Your code has an indentation error. You may need to add pass on a new line to form a valid block of code.

Could share the code which is throwing this error please?
Enclose it within two sets of triple backticks so that it displays correctly on the forum.
You can do this manually or use the Preformatted Text tool (</> icon or CTRL+e) to create the backticks for you.

im sorry i dont know what that is

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

is this a backticks :`:

Yes. You can also just highlight the text and click the code button in the editor which looks like this: </>

thanks for telling me but im still stuck on what to do with ` and <> stuff
to fix the problem

Look at the gif which @pkdvalis posted. It shows you how to use the Preformatted Text tool, to create two sets of triple backticks.

Paste your code in, try it out and see

for i in text:

print(i)

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

yes its like that its higlighted