# Build a Caesar Cipher - Step 16

**URL:** <https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376>\
**Category:** General\
**Tags:** deutsch\
**Created:** [December 25, 2025, 11:16am UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376 "2025-12-25T11:16:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolfgang1](https://avatars.discourse-cdn.com/v4/letter/w/278dde/32.png) [@wolfgang1](https://forum.freecodecamp.org/u/wolfgang1)\
**Post date:** [December 25, 2025, 11:16am UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/1 "2025-12-25T11:16:57Z")

</div>

I can’t find the problem …

### Your code so far

```py

# User Editable Region

def caesar(text, shift):
    if not isinstance(shift, int):
        return 'Shift must be an integer value.' 
  

# User Editable Region

    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]
    translation_table = str.maketrans(alphabet + alphabet.upper(), shifted_alphabet + shifted_alphabet.upper())
    return text.translate(translation_table)

encrypted_text = caesar('freeCodeCamp', 3)
print(encrypted_text)

```

### Your browser information:

User Agent ist: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36`

### Challenge Information:

Build a Caesar Cipher - Step 16

> **[freeCodeCamp.org](https://www.freecodecamp.org/german/learn/python-v9/workshop-caesar-cipher/step-16)**
>
> Lerne Programmieren - kostenlos

---

<div class="post-metadata">

**Author:** ![Ray13](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ray13/32/351582_2.png) [@Ray13](https://forum.freecodecamp.org/u/Ray13)\
**Post date:** [December 25, 2025, 1:21pm UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/2 "2025-12-25T13:21:19Z")

</div>

Hi there and welcome to the forum!  
Please tell us what error messages you have received and what you have done to fix them.  
It will be much easier for us to help you with this information.  
Thanks

---

<div class="post-metadata">

**Author:** ![wolfgang1](https://avatars.discourse-cdn.com/v4/letter/w/278dde/32.png) [@wolfgang1](https://forum.freecodecamp.org/u/wolfgang1)\
**Post date:** [December 25, 2025, 2:17pm UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/3 "2025-12-25T14:17:32Z")

</div>

Error message is:

Sorry, your code does not pass. You’re getting there.

Your `if` statement should use `True` as its condition.

but the code is fully functional …

---

<div class="post-metadata">

**Author:** ![Ray13](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ray13/32/351582_2.png) [@Ray13](https://forum.freecodecamp.org/u/Ray13)\
**Post date:** [December 25, 2025, 4:27pm UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/4 "2025-12-25T16:27:42Z")

</div>

But you need to fulfill the requirements to pass the task.

> Your `if` statement should use `True` as its condition.

So why do you ignore this hint?

> [@wolfgang1](#):
>
> `if not isinstance(shift, int):`

There is no `True` condition in your `if` statement

---

<div class="post-metadata">

**Author:** ![wolfgang1](https://avatars.discourse-cdn.com/v4/letter/w/278dde/32.png) [@wolfgang1](https://forum.freecodecamp.org/u/wolfgang1)\
**Post date:** [December 26, 2025, 9:31am UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/5 "2025-12-26T09:31:59Z")

</div>

> [@wolfgang1](#):
>
> Caesar Cipher - Step 16

It works now, but I don’t know why! What’s the point of checking for True here? I didn’t understand the IF construct that way. In this case, the result is wrong, since Shift is an INT. How does IF know that the query refers to Shift and not text?

Thanks!

---

<div class="post-metadata">

**Author:** ![Diarmond](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@Diarmond](https://forum.freecodecamp.org/u/Diarmond)\
**Post date:** [January 24, 2026, 1:54pm UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/6 "2026-01-24T13:54:40Z")

</div>

The bool isn’t necessarily what the if statement wants it’s just holding the place for “True“ for something that will be asked later on that should be true. a few steps later it asked for “if shift \< 1 or shift \> 25: …” and that beeing true is necessary. i think you have already understood what i mean since your topic is a month old but i say this for the next people that have the same question in mind.

Have fun programming with python!

Keywords for when someone looks for this: Caesar cipher step 16 step 17 step 18 if True

---

<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:** [May 7, 2026, 7:44am UTC](https://forum.freecodecamp.org/t/build-a-caesar-cipher-step-16/771376/7 "2026-05-07T07:44:34Z")

</div>

Closed on May 7, 2026, 7:44am UTC

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