Learn String Manipulation by Building a Cipher - Step 40

Tell us what’s happening:

It’s telling me that. At the beginning of your loop body, print the result of comparing char with a space (’ '). Use the equality operator == for that. Could someone point out where I am going wrong?

Your code so far


# User Editable Region

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

# User Editable Region

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 40

Hi there :waving_hand:
You forgot to add a space between the quotation marks. The lesson specifically asks to compare with a space character, not an empty string. Just double-check the instruction carefully. Keep going — you’re close!