Learn String Manipulation by Building a Cipher - Step 49

Tell us what’s happening:

It keeps telling me to fix what I have done. I’ve read the entire internet before posting this. 30min on this lesson so far. I hit reset & followed instructions perfectly (obviously missing something here)

Your code so far


# User Editable Region

text = 'Hello Zaira'
shift = 3
def ceasar():
    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('plain text:', text)
    print('encrypted text:', encrypted_text)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 49

1 Like

if I tell you you have a typo, can you spot it?

1 Like

I never knew learning python would require me to learn both math, and how to spell :frowning: the darn “A” is silent & apparently as I compared it to the instructions which clearly spells it out my dyslexic brain thought it was a perfect match. Thank you!!!