Learn String Manipulation by Building a Cipher - Step 37

Tell us what’s happening:

I have the variable before the for loop in the code just as directed w/ the empty string. Its still saying that I’m not doing it correctly, I’m honestly lost, as its not giving much direction on what I’m doing wrong. I placed a space between the quotation marks and it still comes up incorrect.

Your code so far


# User Editable Region

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

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 37

I am afraid you misspelled encrypted_text. It is missing a p between y and t

1 Like

And also appears you added a space between the quotation marks.
There should be no space between.

:+1: Happy coding