Tell us what’s happening:
I have no idea why my code is not being accepted. Enlighten me please🙏.
Your code so far
# User Editable Region
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[shift:]
print(shifted_alphabet)
new_alphabet = alphabet[:shift] + ' ' + alphabet[shift:]
print(new_alphabet)
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0
Challenge Information:
Build a Caesar Cipher - Step 4
https://www.freecodecamp.org/learn/full-stack-developer/workshop-caesar-cipher/step-4
ILM
September 6, 2025, 7:17am
2
do you think your new alphabet should contain spaces?
ILM:
contain
I guess not but even without spaces, it doesn’t work
ILM
September 6, 2025, 10:35am
4
cab you share your updated code?
oh, wait, you have not updated shifted_alphabet, instead you created a new variable
I have opened an issue to make the instructions more clear
opened 10:37AM - 06 Sep 25 UTC
help wanted
scope: curriculum
https://www.freecodecamp.org/learn/full-stack-developer/workshop-caesar-cipher/s… tep-4
It is missing the instruction that you should update `shifted_alphabet`
Same for the hint, it's missing there too
I still can’t progress, is this what I was supposed to do;
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
shift = 5
shifted_alphabet = alphabet[shift:]
print(shifted_alphabet)
shifted_alphabet = alphabet[:shift] + alphabet[shift:]
print(shifted_alphabet)
ILM
September 6, 2025, 12:08pm
6
you should not duplicate lines, update that first line in which you are creating shifted_alphabet
Like so?
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
shift = 5
shifted_alphabet = alphabet[:shift] + alphabet[shift:]
print(shifted_alphabet
ILM
September 6, 2025, 3:32pm
8
that would be the intended way to pass the step yes
Since this code wasn’t accepted either, should I just give up for now?
ILM
September 6, 2025, 4:26pm
10
no, you should reset the step and try again, and share your updated code if it does now work
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.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
you’ll need to add them at the end of the shifted alphabet.
The correct output in the console should be:
fghijklmnopqrstuvwxyzabcde
This way the alphabet has “shifted” 5 characters. The 6th character is now the 1st character.
1 Like
It finally worked…I did exactly as @pkdvalis said. I appreciate the help so much and look forward to troubling you with more queries.
loreta
September 12, 2025, 10:43am
13
code removed by moderator
ILM
September 12, 2025, 2:36pm
14
hi @loreta
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
1 Like