Build a Caesar Cipher - Step 11

Tell us what’s happening:

I am not quite sure what I am doing wrong. It says to remove the text and shift from the caesar but as soon as i do it says to add it in? Can someone please help walk me through this step? I feel so confused and defeated with this. This is also the first time I have ever done anything with coding.

Your code so far


# User Editable Region

def sum(text, shift):
    pass
def caesar(text, shift):
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    shift = 5
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]
    translation_table = str.maketrans(alphabet, shifted_alphabet)
    text = 'hello world'

# User Editable Region

    encrypted_text = text.translate(translation_table)
    print(encrypted_text)

Your browser information:

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

Challenge Information:

Build a Caesar Cipher - Step 11

Welcome to the forum @hannah.m.beck98

You are not asked to include the sum function, it is only given as an example.

Please remove the shift and text variable declarations from the function body.

Happy coding

Thank you so much! I got it!

1 Like