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

Cuéntanos qué está pasando:

I can’t find the error, it is well identified, the code through the console passes fine, it throws me this error:
You should rename all occurrences of text to message.
Help me!

Tu código hasta el momento

text = 'Hello Zaira'
shift = 3

# User Editable Region

def caesar(message = text, offset = shift):
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    encrypted_text = ''

    for char in text.lower():
        if char == ' ':
            encrypted_text += char
        else:
            index = alphabet.find(char)
            new_index = (index + offset) % len(alphabet)
            encrypted_text += alphabet[new_index]
    print('plain message:', message)
    print('encrypted text:', encrypted_text)

caesar()

# User Editable Region

Información de tu navegador:

El agente de usuario es: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36

Información del Desafío:

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

Welcome to the forum @JuanciDev

Here is a comparison of the original code and your code.

The code in blue is the original code, the code in red is your code.
The code in magenta is the overlap.

image

For this challenge, you did not need to reassign the varibles, just change their names.

Inside your function body, rename the text and shift variables to message and offset , respectively.

You changed the string from plain text to plain message
The instructions asked to only change the variables.

Here is one place where the text variable is not updated.

image

Happy coding