The Build a Caesar Cippher - Step 22 challenges becomes tricky with a logical error. You will write a proper code, get a result, but then you have not passed the correct logical flow of the code. You are going to be stuck with logical error, but then I will give solution and explain the flow.
the answer:
code removed by moderator
but then this “if” condition block needs to be the last if block, because:
The logic process:
- Validate shift type → must be int
- Validate shift range → must be 1–25 (positive, so validation passes)
- Flip shift if decrypting → shift = -shift
- Build alphabet and translate
therefore the code should be:
code removed by moderator