The 40th question

At the beginning of your loop body, print the result of comparing char with a space (' ' ). Use the equality operator == for that.

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

You should compare char with a space using the equality operator inside your for loop.

Hello. Welcome to our forum!
This is what you have done.
You have compared a char with a space here.

Then you have printed it here.

This is contrary to what you were supposed to do. You were supposed to have the comparison statement in the print statement, that way, your statement will be executed and printed to the console simultaneously.