Learn String Manipulation by Building a Cipher - Step 26

Tell us what’s happening:

u should declare a new variable named index at the beginning of your for loop.

Your code so far

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

# User Editable Region

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


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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 26

Hi there, welcome to the community! :blush:The issue you’re facing is in the following code:

You wrote this, but the lesson requires you to:

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.

To fix this, reset the lesson, then declare the index variable before print and assign it to alphabet.find(char). This should align with the lesson’s instructions.