Build a Caesar Cipher - Step 4

Tell us what’s happening:

I am stuck on this code, Pls someone should assist

Your code so far


# User Editable Region

alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
# First part: from index 5 to the end
shifted_alphabet = alphabet[shift:]
print(shifted_alphabet)
# Concatenate the missing first part to complete the shift
shifted_alphabet = alphabet[0:5] + alphabet[shift:]  
print(shifted_alphabet)

# 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/143.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 4

You only need 1 line of code for the slicing syntax:

shifted_alphabet = alphabet[0:5] + alphabet[shift:] 

Look at the instructions and consider what order the text should go in - it says extract and concatenate it to.

You have hard coded. Consider also what value the variable ‘shift’ represents.

No need to add another print log.

I have tried severely, I can’t proceed

Please, someone should help. I am stuck

I would suggest you reset and try again. You have added too many lines of code. You work on the code that is already there.

You are working on the variable shifted_alphabet. It says you need to concatenate the missing 5 letters to the end of the shifted _alphabet variable. You haven’t done this.

The example code tells you how to extract a portion from a variable. Instead of hard coding how you originally did it think of the variables you already have and how they can be used here.

Thanks, I have gotten it

mod edit - solution removed