Learn String Manipulation by Building a Cipher - Step 57

Tell us what’s happening:

I saw other questions and they were completely different it was like, they were at lvl 70

Your code so far


# User Editable Region

text = 'Hello Zaira'
shift = 3

def Vigenere():
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    encrypted_text = ''

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

vigenere()
vigenere()

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 57

For this step you are asked to remove this two lines:

caesar(text, shift)
caesar(text, 13)

Do not modify the rest of the code if not required, because it might make the tests fail.

But why did they ask to convert caesar to vigenere

You’ve completed the Caeser cipher, and now you are going to change many parts of the code to transform it into a Vigenère cipher.

This will be many steps and this is just the first small step.

The Python curriculum was recently updated so the Step #'s in older posts will no longer match the Step you are on. If they aren’t making sense, this probably why.

Oh that’s why It was so different

1 Like