Aprenda la Manipulación de Cadenas Construyendo un Cipher - Step 40

Cuéntanos qué está pasando:

Step 40
I need your help, I don’t understand the problem that the code generates, the error that it gives me is “You should print the result of comparing char with a space inside your for loop.”; I already tried searching in the forum and tried several methods but it keeps giving me the same error.

Tu código hasta el momento


# User Editable Region

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)

# User Editable Region

Información de tu navegador:

El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

Información del Desafío:

Aprenda la Manipulación de Cadenas Construyendo un Cipher - Step 40

Welcome to the forum @azulhmz

For this step you need to place the comparison in a print call.

Happy coding