Learn String Manipulation by Building a Cipher - Step 35

Tell us what’s happening:

hey… did someone can give me help about this?? i can’t fix it. i indonesian, so, i don’t understand correctly.he told me to:
Now you need to create a new_char variable at the end of your loop body. Set its value to alphabet[new_index] .

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
alphabet[new_index]= alphabet
new_char = alphabet[new_index]

for char in text.lower():
    index = alphabet.index(char)
    new_index=(index+shift)%len(alphabet)
    new_char = alphabet(new_index)
    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/123.0.0.0 Safari/537.36 OPR/109.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 35

You’ve attempted it a few times here, you’ll need to reset the step and try it again.

You can see the example shows you square brackets, so use those to access the index.

Do you know where the end of the loop body is?

no i dont know… tech me

Well you got it right once so I think you do know. Reset the step, try again, use the square brackets and share your updated code please

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.