Learn String Manipulation by Building a Cipher - Step 49

Tell us what’s happening:

So here is my problem
I have to define a new custom function for my caesar cipher
when I write def caesar_name(): It tells me I need to add to parenthesis
I redo do it, and then it tells me I need to add an indentation after shift = 3
I do that
The terminal says its an unnecessary indentation
I remove it
Now its telling me to add the def term that’s already there
So can someone explain to me whats going on? :tired_face:

Your code so far

# User Editable Region

text = 'Hello Zaira'
shift = 3

def caesar_function():

alphabet = 'abcdefghijklmnopqrstuvwxyz'
encrypted_text = ''

for char in text.lower():
    if char == ' ':
        encrypted_text += char
        index = alphabet.find(char)
        new_index = (index + shift) % len(alphabet)
        encrypted_text += alphabet[new_index]
print('plain text:', text)
print('encrypted text:', encrypted_text)

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 49

Hi, and welcome to the forum! :wave:

Your new function will be called caesar not “caesar_name”

Here is the indentation and syntax:

def funcname():

Remember to

indent all the following lines

ALL of them. If it’s indented, it’s part of the function.