Build a Caesar Cipher - Step 15

Tell us what’s happening:

im struck here can i get help please.. not sure what im missing

Your code so far

def caesar(text, shift):
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    
    uc_alphabet = alphabet.upper()
    shifted_alphabet = alphabet[shift:] + alphabet[:shift] + uc_alphabet [shift:] + uc_alphabet[:shift]


# User Editable Region

    
    translation_table = str.maketrans(alphabet,uc_alphabet, shifted_alphabet)

# User Editable Region

    return text.translate(translation_table)


encrypted_text = caesar('freeCodeCamp', 3)
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/142.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 15

Welcome to the forum @sriharshavvss

Update your str.maketrans() call by concatenating to each argument the uppercase version of the argument itself.

You started with two arguments, but added a third - which you were not asked to do.

Please reset the step to restore the seed code.

Make sure you concatenate the upper case version of each argument.

Happy coding

ahh , sure, haha thanks

1 Like