Build a Caesar Cipher - Step 15

Tell us what’s happening:

Even when I try to make my arguments uppercase by .upper and trying to concatenate both of them, the program keeps saying the same thing. I have tried every combination I could find, and the one in the photo is the result of me searching google and trying a new thing

Your code so far

def caesar(text, shift):

    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]

    result = alphabet.upper() + " " + shifted_alphabet.upper()

# User Editable Region
    translation_table = str.maketrans
    (result)
# User Editable Region

encrypted_text = caesar('freeCodeCamp', 3)
print(encrypted_text)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 15

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-caesar-cipher/6818fcb250f34e62cab32c39.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @fby121,

I would start by resetting this step since you have changed a lot of the starting code that shouldn’t have been changed.

If you print shifted_alphabet, you’ll see that it only contains lowercase letters.

And on this line, we’re passing alphabet and shifted_alphabet — both with only lowercase letters — to maketrans:

translation_table = str.maketrans(alphabet, shifted_alphabet)

So, in this step, we need to also pass in the uppercase letters for both alphabet and shifted_alphabet .

To do that, you just need to concatenate the uppercase version of each of those variables to the variables themselves.

Hope that helps.