Build a Caesar Cipher - Step 15

Tell us what’s happening:

i am trying to use the argument upper for the value of translate text but not working

Your code so far

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

# User Editable Region

    translation_table = str.maketrans(upper(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/139.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 15

you can’t use upper like that, it is a method, please review the example

hoe to? i tried several ways but did not pass

look at the example, see how upper is written after the string and there is nothing between the parentheses

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

i tried this but not passing

you need to have the lowercase letters immediately followed by the uppercase letters, you need to create this string by concatenating the alphabet with the lowercase letters followed by the same alphabet that has been made all uppercase

this for both arguments, as they need to have the same length

Could you give some more detail about how the solution should be formatted or just the answer here tbh? I’ve tried every combo I can think of for this based on the given example(adding .upper() to the existing strings in various ways), google(creating the upper strings separately, combining them and adding them to the str.maketrans()) and your answer here but i’m still stuck. Normally the console feedback thingy is helpful for making progress when im stuck but its just the same message saying draw the rest of the owl no matter what I do and its been 2 hours of no progress.

hi @LearningCode1 please create your own topic for your questions, we are unable to help you in someone else’s topic

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’m having an issue with my code!

translation_table = str.maketrans(alphabet.upper() + “ “ + shifted_alphabet())

hi @gizzz333 , we are unable to help you in someone else’s topic, please create your own topic

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.