Aprenda la Manipulación de Cadenas Construyendo un Cipher - Paso 37

Cuéntanos qué está pasando:

No puedo pasar con mi código y e probado de todo me pueden ayudar por favir

Tu código hasta el momento


# User Editable Region

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

for char in text.lower():
    index = alphabet.find(char)    
    new_index = index + shift
    encrypted_text = 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/137.0.0.0 Safari/537.36

Información del Desafío:

Aprenda la Manipulación de Cadenas Construyendo un Cipher - Paso 37

Now, replace new_char with encrypted_text.

new_char = alphabet[new_index]

changed to:

encrypted_text = encrypted_text + alphabet[new_index]

You’ve done a bit more than just change the name of the variable.

Has hecho algo más que simplemente cambiar el nombre de la variable.

Simplemente haga exactamente lo que dicen las instrucciones y nada más.