Вивчіть маніпуляцію рядками, створивши шифр - Крок 50

Розкажіть нам, що сталося:

I don’t know where I’m making a mistake. the task says to move plain text to print after for

Ваш код


# User Editable Region

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

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

# User Editable Region

Інформація про ваш браузер:

Агент користувача: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0

Інформація про завдання:

Вивчіть маніпуляцію рядками, створивши шифр - Крок 50

the plain text print should go first, then the encrypted text print call

thank you :heart_on_fire:, i understand