Learn String Manipulation by Building a Cipher - Step 29

Tell us what’s happening:

I have tried different ways to solve this problem. I Need help to solve it.

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
new_index = index + 3
for char in text.lower(): 
    index = alphabet.find(char)
    print(char, index)

# User Editable Region

Your browser information:

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 29

Have you looked at the error that’s displayed when this code is run? To quote it:

Traceback (most recent call last):
  File "main.py", line 6, in <module>
NameError: name 'index' is not defined