Learn String Manipulation by Building a Cipher - Step 26

Tell us what’s happening:

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

Your code so far

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

# User Editable Region


for char in text:    print(char)
index = alphabet.find(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/125.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 26

Hi, welcome to the forum! :wave:

Did you have a specific question or something that’s unclear?

It can help us to know what to explain.

Other than that I would try resetting the step, do not alter the indentation. Indentation matters in Python, indentation is syntax and it needs to be 100% correctly done. You can revisit step 24 for a primer on for loop syntax and indentation:

https://www.freecodecamp.org/learn/scientific-computing-with-python/learn-string-manipulation-by-building-a-cipher/step-24

" So, when no indented block is found after the final colon, the code execution stops and an IndentationError is thrown."

Read the instructions carefully,

before printing the current character, declare a variable called index