Learn String Manipulation by Building a Cipher - Step 35

Tell us what’s happening:

i can not understand and go from this step can u help me?

Your code so far


# User Editable Region

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

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; rv:107.0) Gecko/20100101 Firefox/107.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 35

print new_char and see the output.

Hey, have you tried anything?

1 Like

You have a print function in the code already.

print(char, index)

Use that same function but print new_char instead (on the last line inside the loop).

1 Like

Yes, it actually worked ,Thanks alot

I did as you said thanks