Build a Caesar Cipher - Step 10

Tell us what’s happening:

how to define the function with the correct indentation ?

Your code so far


# User Editable Region

def spam():
    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)
print("spam! ")

# 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/142.0.0.0 Safari/537.36 Edg/142.0.0.0

Challenge Information:

Build a Caesar Cipher - Step 10

Create a function named caesar. Put all your existing code within the function body. Pay attention to keep the same indentation level for all of the lines within the function body.

Make sure you’re defining the function with the specified name (not the name in the example). You need to indent all lines of code, not just the first line. Don’t modify any of the existing code, only indent it. It might be easiest to hit the Reset button and start this step again.