Python test-caesar cipher

encrypted_text =''

def caesar(text, shift):

    alphabet = 'abcdefghijklmnopqrstuvwxyz'

    shifted_alphabet = alphabet\[shift:\] + alphabet\[:shift\]

    translation_table = str.maketrans(alphabet, shifted_alphabet)

    encrypted_text = text.lower().translate(translation_table)

    return encrypted_text

encrypted_text = caesar('freeCodeCamp', 3)

print(encrypted_text)

Sorry, your code does not pass. Hang in there.

You should assign caesar('freeCodeCamp', 3) to the encrypted_text variable.

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Can you post a link to the workshop step that you’re working on?

It’s a bit suspicious that you have an encrypted_text variable inside your function and outside the function. Right?

and you have this too

hi @kerinaqwe

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.