Build a Caesar Cipher - Step 12

Tell us what’s happening:

Hello, I am on step 12 of the Caeser cipher.
I think I have done what the instructions asked but I cannot seem to pass this step.
Please could someone provide some insights on this.

Your code so far

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

# User Editable Region

encrypted_text = caesar('freecodecamp', 3)



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

Challenge Information:

Build a Caesar Cipher - Step 12

make sure you are using the string you are asked to use

capitalisation matters

1 Like

hi. i am stuck at the same position. can someone help us please

hi @pamen , please create your own topic so you can get the focused help you deserve

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

i give the same answer but still my code does not pass

please create your own topic