Build a Caesar Cipher - Step 10

Tell us what’s happening:

Hi, can anyone tell me what is wrong with my code? I did reset the code and rewrite it so many time but it does not pass. I am sure that everything is correct already.

Your code so far


# User Editable Region

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

# 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/143.0.0.0 Safari/537.36 Edg/143.0.0.0

Challenge Information:

Build a Caesar Cipher - Step 10

Hi.

Why did you make this change?

    print(caesar)

It was written in the code example to insert print after the function. Or should I just delete that?

Yes, it’s just an example of how to create a function.

i have deleted it. but it’s not working yet and i can’t proceed to the next step i don’t know why.

you are missing a print, as there was a statement printing encrypted_text in the code with which you started this step

so i need to add print(encrypted_text) under encrypted_text?

it’s working! thanks!