Building a caesar cipher step 10

Hi I am on my second workshop building a caesar cipher and am stuck on step 10. Any help in how I can move pass this particular message I keep getting or what I am doing wrong. “You should move all the code you wrote so far within the caesar function body. Make sure you keep the same indentation level for all of the lines within the function body..”

def caesar():

shift = 5

alphabet ='abcdefghijklmnopqrstuvwxyz'

text = 'hello world'

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

translation_table = str.maketrans(alphabet, shifted_alphabet)

encrypted_text = text.translate(translation_table)

this is the code so far.

Please post a link to the challenge.

And format your code, as follows, so the indentation is retained and there are no escaped characters:

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 (').

It looks like you may have changed the starting code in areas you were not asked to change, which will cause the tests to fail. Please click the reset button to restore the original code and try again.

image

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.