Learn String Manipulation by Building a Cipher - Step 29

Tell us what’s happening:

I am not sure what this is asking me to do. here is the code that i inputed

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

for char in text.lower():
index = alphabet.find(char)
new_index = (index + shift)
print(char, index)

I also consulted chat gpt and this is what it gave me

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

for char in text.lower():
index = alphabet.find(char)
new_index = (index + shift) # Declare new_ind

Your code so far


# User Editable Region

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

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 29

that is not the end of the loop body, the new_index needs to be the last thing in the loop

GPT will happily lie to you. It’s best to ask humans until you have built up enough skills to tell when GPT is lying

Here it looks like GPT deleted the print even though the instead don’t ask for that