Build a Caesar Cipher - Step 4

Tell us what’s happening:

Why isn’t my code working? see below

Your code so far


# User Editable Region

alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[shift:]
added_letters =   alphabet[shift:] + alphabet[0:5]
print(added_letters) 

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0

Challenge Information:

Build a Caesar Cipher - Step 4

Welcome back to the forum @Lucien516

You should assign the concatenation of alphabet[shift:] and the missing first portion of alphabet to the shifted_alphabet variable. Use shift to specify where to stop the slicing.

You are asked to use a specific index.

What is the added_letters variable for?

Happy coding

You’re almost there—the issue is your shifted alphabet.
alphabet[shift:] only takes the tail; you also need the wrapped head redacted[1]. Use redacted[2] instead of [0:5] so it works for any shift.


  1. Redacted by moderator ↩︎

  2. Redacted by moderator ↩︎

hi @archana115

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.

hey @nickgeremia1
please create your own topic, we are unable to give you the focus you deserve if you write in someone else’s topic

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.