Build a Caesar Cipher - Step 11 in:title

This is as far as I have managed to code the Caesar cipher.

def caesar():

    alphabet = 'abcdefghijklmnopqrstuvwxyz'

    shift = 5

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

    translation_table = str.maketrans(alphabet, shifted_alphabet)

    text = 'hello world'

    encrypted_text = text.translate(translation_table)

    print(encrypted_text)

def caesar (text,shift):

    alphabet = 'abcdefghijklmnopqrstuvwxyz'

    offsetted_alphabet = alphabet\[offset:\] + alphabet\[:offset\]

    translation_table = str.maketrans(alphabet, offsetted_alphabet)

    message = 'hello world'

    encrypted_message = message.translate(translation_table)

`
Instructions are not to use text and shift, so i changed to messge and offset. It still did not pass. Please 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 (').