Learn String Manipulation by Building a Cipher - Step 43

Tell us what’s happening:

I am not quite what the instructions are asking me to do here. I tried changing the encrypted_text value as well as adding it with the addition operator

Your code so far


# User Editable Region

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

for char in text.lower():
    if char == ' ':
        encrypted_text += char
        print('space!')
    index = alphabet.find(char)
    new_index = index + shift
    encrypted_text += alphabet[new_index]
    print('char:', char, 'encrypted text:', encrypted_text)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 43

I solved it. Thank you! The instructions should be a little more clear for this step

Do you have any suggestions?

freeCodeCamp is open source and your ideas could be implemented. It helps to be very specific though.