Learn String Manipulation by Building a Cipher - Step 43

Tell us what’s happening:

I don’t understand what the question is and how I should be making the answer. Maybe brackets? I’ve tried to do ‘space!’ += encrypted_text and it doesn’t work please help

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
    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 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 43

i am stuck too but maybe try adding char to the ecrypted_text += alpha[new_index] code becuase its telling me i have to add char to the value of alpha so it might work

if you want to add something to encrypted_text, it needs to go to the left of the +=. And you want to add char to encrypted_text