Build a Caesar Cipher - Step 10

Tell us what’s happening:

i mean what the question ask me to do, pls help or at least explain me

Your code so far


# User Editable Region

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)

def caesar():
    print(encrypted_text)

caesar()

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 OPR/125.0.0.0

Challenge Information:

Build a Caesar Cipher - Step 10

Step 10 asks you to create a function and put all your code into that function.

Welcome to the forum @rizqullah.ahsan

For this step you are asked to create a function. The body of the function will consist of the seven lines of code in the editor.

Carefully examine the example code on how to define a function.

Happy coding

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