MANIPLACION DE CADENAS MEDIANTE LA CREACION DE UN CIFRADO paso 49

text = ‘Hello Zaira’

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

encrypted_text = ’ ’

shift = 3

def caesar():

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('plain text:',text)

        print('encrypted text:', encrypted_text)

donde esta mi error gracias de antemano.

Please post a link to the challenge/step you are working on.

yes, please post here the link to the challenge you are working on

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.