Build a Caesar Cipher - Step 4

Tell us what’s happening:

I cant pass this section and Im unsure where I went wrong


# User Editable Region

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

# User Editable Region

Here’s the result I’m given:

fghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build a Caesar Cipher - Step 4

the goal of your challenge is to re assemble the alphabet into a new string that contains one of each letter thats shifted over.

I can see a couple things wrong but youre close,
first, im not sure if youre getting a space in the middle of your shifted alphabet but you might be.
focus on the very last part of the story, specifically how the SLICE function uses the operators in the brackets [start:stop:step]

sorry, i edited this i mean how the slice function works.

another thing i forgot to mention is that you have your print call in the middle of your function so its printing before the rest of your function has a chance to work. you also have 2 sepparate print calls

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

Would it be something like this?

yea, now all you need to do is concatenate the two halves, sort of like what you were working on before, review your output with the print command like you have and you should be able to finish the concatenation.
it explains concatenation in the first half of the story.

do you think you are getting the 26 letters of the alphabet like this?
also you need to continue the already existing line, do not create a new line to update the value of shifted_alphabet

1 Like
alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[0:5]
print(shifted_alphabet)

Im still getting an error

you need to have all the letters of the alphabet, with this alphabet[0:5] you are only getting the first few, look at the terminal

reset the step, add to the line, do not delete anything. What you need to add to the line is the remaining letters of the alphabet using the slice syntax

Thank you! I was able to pass