# Problem with step 49\_indentation error

**URL:** <https://forum.freecodecamp.org/t/problem-with-step-49-indentation-error/764385>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [October 12, 2025, 1:43pm UTC](https://forum.freecodecamp.org/t/problem-with-step-49-indentation-error/764385 "2025-10-12T13:43:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shenoudaelia838](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/shenoudaelia838/32/379601_2.png) [@shenoudaelia838](https://forum.freecodecamp.org/u/shenoudaelia838)\
**Post date:** [October 12, 2025, 1:43pm UTC](https://forum.freecodecamp.org/t/problem-with-step-49-indentation-error/764385/1 "2025-10-12T13:43:38Z")

</div>

Hi everyone,

I’m currently working on Step 49 of the Caesar Cipher project on FreeCodeCamp.

I keep getting this error message:

“Your code has an indentation error. You may need to add pass on a new line to form a valid block of code.”

I tried using def and if as required, but it still doesn’t work.

Here’s my code:

```py
def encrypt_text():

    text = 'Hello World'

    shift = 3

    alphabet = 'abcdefghijklmnopqrstuvwxyz'

    encrypted_text = ''

    for char in text.lower():

        if char == " ":

            print("space!")

        else:

            index = alphabet.find(char)

            new_index = index + shift

            encrypted_text += alphabet[new_index]

            print('char:', char, 'encrypted text:', encrypted_text)

encrypt_text()

```

Can someone please help me figure out what’s wrong?

Thank you!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [October 12, 2025, 4:47pm UTC](https://forum.freecodecamp.org/t/problem-with-step-49-indentation-error/764385/2 "2025-10-12T16:47:51Z")

</div>

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.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [October 12, 2025, 4:48pm UTC](https://forum.freecodecamp.org/t/problem-with-step-49-indentation-error/764385/3 "2025-10-12T16:48:12Z")

</div>

is this the step?

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/scientific-computing-with-python/learn-string-manipulation-by-building-a-cipher/step-49)**
>
> Learn to Code — For Free

if it’s so, you are not asked to create `encrypt_text` function, please read the instructions more carefully

you also have a lot of code that should not be there for step 49. Please confirm what step you are asking help for

---

<div class="post-metadata">

**Author:** ![Naomi](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/naomi/32/422181_2.png) [@Naomi](https://forum.freecodecamp.org/u/Naomi)\
**Post date:** [January 13, 2026, 6:50pm UTC](https://forum.freecodecamp.org/t/problem-with-step-49-indentation-error/764385/4 "2026-01-13T18:50:38Z")

</div>

Closed on January 13, 2026, 6:50pm UTC


