Build a Caesar Cipher - Step 22

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:

  1. Validate shift type → must be int
  2. Validate shift range → must be 1–25 (positive, so validation passes)
  3. Flip shift if decrypting → shift = -shift
  4. Build alphabet and translate

therefore the code should be:

code removed by moderator

Welcome to the forum @kennedychukwu,

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.
If you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler] and [/spoiler] tags on the line above and below your solution code.

Happy coding